예제 #1
0
        public void ParseData_WithMixedData_ReturnsGoodRecords()
        {
            // Arrange
            var logger = new FakeLogger();
            var parser = new DataParser(logger);

            // Act
            int processedRecords = parser.ParseData(TestData.Data);

            // Assert
            Assert.AreEqual(7, processedRecords);
        }
예제 #2
0
        public void ParseData_GoodRecord_ReturnsOne()
        {
            // Arrange
            var logger = new FakeLogger();
            var parser = new DataParser(logger);

            // Act
            int processedRecords = parser.ParseData(TestData.GoodRecord);

            // Assert
            Assert.AreEqual(1, processedRecords);
        }
예제 #3
0
        public void ParseData_BadRating_ReturnsZero()
        {
            // Arrange
            var logger = new FakeLogger();
            var parser = new DataParser(logger);

            // Act
            int processedRecords = parser.ParseData(TestData.BadRating);

            // Assert
            Assert.AreEqual(0, processedRecords);
        }
예제 #4
0
        private DataParser GetParserWithFakeLogger()
        {
            var logger = new FakeLogger();

            return(new DataParser(logger));
        }