Title / Description
Code describe("Test data aggregation within D2DMetricsDataStream", function () { //Configuration var T_SAMPLE_POINT = 5; //local variables var myInstance; beforeEach( function () { //Set Up //Create a new instance of our controller-under-test myInstance = new D2DMetricsDataStream( { timestampColIndex : 0 ,dataColIndex : 1 ,samplePoint : T_SAMPLE_POINT } ); } ); afterEach( function () { //Tear Down myInstance = null; } ); it ("Aggregates simple data correctly", function () { var testInputArray = [ [15,5], [6,15], [5,10], [1,5], [0,10], [0,5] ]; var testInputTimestamp = 15; var expectedOutcome = [ [15,5,1], [10,0,0], [5,25,2], [0,20,3] ]; var result = myInstance.aggregatePointArray( testInput, testInputTimestamp ); expect( result ).toEqual( expectedOutcome ); } ); } );
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code