Beispiel #1
0
        public void addThreeRecordsAndThreeDummyRecords_DummyRecordsAreExpectedToGenerateTheirOwnTwoSeries()
        {
            var outputBuffer = new OutputBuffer()
            {
                Appender = Substitute.For <IRecordAppender>()
            };

            outputBuffer.AppendRecord(new double[] { 3 });
            outputBuffer.AppendRecord(new double[] { 2 });
            outputBuffer.AppendRecord(new double[] { 1 });
            outputBuffer.AddDummyRecord();
            outputBuffer.AddDummyRecord(2);

            Assert.AreEqual(6, outputBuffer.Series);
            Assert.AreEqual(3, outputBuffer.DummyRecords);
        }
Beispiel #2
0
        public void addOneRecord_BufferShouldContainOneSeries()
        {
            var outputBuffer = new OutputBuffer()
            {
                Appender = Substitute.For <IRecordAppender>()
            };

            outputBuffer.AppendRecord(new double[] { 1 });

            Assert.AreEqual(1, outputBuffer.Series);
        }
Beispiel #3
0
        public void addRecordsToOutputBuffer_RecordsAreAddedToFormThreeSeries_NumberOfCountedSeriesShouldBeThree()
        {
            var records = new IRecord[]
            {
                new Record(new double[] { 3 }),
                new Record(new double[] { 2 }),
                new Record(new double[] { 2 }),
                new Record(new double[] { 1 }),
                new Record(new double[] { 1 }),
                new Record(new double[] { 1 }),
                new Record(new double[] { 1 })
            };
            var outputBuffer = new OutputBuffer {
                Appender = Substitute.For <IRecordAppender>()
            };

            foreach (var record in records)
            {
                outputBuffer.AppendRecord(record);
            }

            Assert.AreEqual(3, outputBuffer.Series);
            Assert.AreEqual(0, outputBuffer.DummyRecords);
        }