Пример #1
0
        public void ProcessEmptyFile()
        {
            var mockLogger = new Mock <ILogger <CSVProcessor> >();

            CSVProcessor processor = new CSVProcessor(mockLogger.Object, this.emptyFileReader, this.config);

            processor.Init(new FoundCSVItem()
            {
                FilePath = (this.folderPath + "TOU_5.csv")
            });
            TaskResult result = null;

            Assert.DoesNotThrowAsync(async() => { result = await processor.ProcessAsync(); });
            Assert.True(result.LowerBoundsValues.Count == 0);
            Assert.True(result.UpperBoundsValues.Count == 0);
            Assert.True(result.Median == 0.0);
        }
Пример #2
0
        public void ProcessKnownResultFile3()
        {
            var mockLogger = new Mock <ILogger <CSVProcessor> >();

            CSVProcessor processor = new CSVProcessor(mockLogger.Object, this.emptyFileReader, this.config);

            processor.Init(new FoundCSVItem()
            {
                FilePath = (this.folderPath + "LP_BIG.csv")
            });
            TaskResult result = null;

            Assert.DoesNotThrowAsync(async() => { result = await processor.ProcessAsync(); });
            Assert.True(result.MedianLowerBound == 1.512);
            Assert.True(result.MedianUpperBound == 2.268);
            Assert.True(result.LowerBoundsValues.Count == 42);
            Assert.True(result.UpperBoundsValues.Count == 59);
            Assert.True(result.Median == 1.89);
        }