Пример #1
0
        public void CalculateMedianValue_NotReady_TrowException()
        {
            var dataColumn          = "Data Value";
            var dateTimeStampColumn = "Date/Time";

            var processor = new MockingFileProcessor(dataColumn, dateTimeStampColumn);

            Assert.That(() => processor.CalculateMedianValue(),
                        Throws.Exception.TypeOf <InvalidOperationException>());
        }
Пример #2
0
        public void CalculateMedianValue_Ready_MatchResult()
        {
            var dataColumn          = "Data Value";
            var dateTimeStampColumn = "Date/Time";

            var file      = GetTestingFileA();
            var processor = new MockingFileProcessor(dataColumn, dateTimeStampColumn);

            processor.SetDataAndPrepareProcessing(file);
            var medianValue = processor.CalculateMedianValue();

            decimal expected = (decimal)29.7125;

            Assert.AreEqual(medianValue, expected);
        }