コード例 #1
0
        public void Should_GetMinScoreOf1_When_GetSmallestPointSpreadIsRun()
        {
            // Arrange
            var report = new SoccerScoreReport <ILeagueScore>(MockedData.GetExpectedScores());

            // Act
            var min = report.GetSmallestPointSpread();

            // Assert
            Assert.AreEqual(1, min);
        }
コード例 #2
0
        public void Should_GetMaxSoccerSpreadOf43_When_GetLargestPointSpreadIsRun()
        {
            // Arrange
            var report = new SoccerScoreReport <ILeagueScore>(MockedData.GetExpectedScores());

            // Act
            var max = report.GetLargestPointSpread();

            // Assert
            Assert.AreEqual(43, max);
        }
コード例 #3
0
        public void Should_GetMinTemperatureOf2_When_GetSmallestTemperatureSpreadIsRun()
        {
            // Arrange
            var report = new WeatherReport <IDailyTemperature>(MockedData.GetExpectedTemperatures());

            // Act
            var min = report.GetSmallestTemperatureSpread();

            // Assert
            Assert.AreEqual(2, min);
        }
コード例 #4
0
        public void Should_GetMaxTemperatureOf54_When_GetLargestTemperatureSpreadIsRun()
        {
            // Arrange
            var report = new WeatherReport <IDailyTemperature>(MockedData.GetExpectedTemperatures());

            // Act
            var max = report.GetLargestTemperatureSpread();

            // Assert
            Assert.AreEqual(54, max); // 86 vs. 32 degrees in weather.dat
        }
コード例 #5
0
        public void Should_ImportFlatFileToModel_When_LayoutDescriptorIsDefined()
        {
            // Arrange
            if (!File.Exists(GetOriginalImportFilePath()))
            {
                throw new Exception("Import file does not exist!");
            }

            var expected = MockedData.GetExpectedTemperatures();

            // Act
            var importer = new WeatherImporter(GetOriginalImportFilePath());
            var model    = importer.GetWeatherReport();

            // Assert
            CollectionAssert.AreEqual(model, expected);
        }