public void CreatesEmptySeasonResultFromInvalidIntParams()
        {
            ISeasonResult result;
            var           sut = new SeasonResultFactory(_mockLoggingService.Object);

            bool success = sut.TryCreate("abc", -1, 3, out result);

            Assert.False(success);
            Assert.Equal(SeasonResult.EmptySeasonResult, result);
        }
Beispiel #2
0
        private static void BuildDependencies()
        {
            // Wiring up dependencies manually for this simple application.
            // Could use DI framework if this were more complex.

            _loggingService = new LoggingService();
            var seasonResultFactory = new SeasonResultFactory(_loggingService);

            _seasonResultFileParser = new SeasonResultFileParser("football.dat", seasonResultFactory, _loggingService);
        }
        public void CreatesSeasonResultFromValidIntParams()
        {
            ISeasonResult result;
            var           sut = new SeasonResultFactory(_mockLoggingService.Object);

            bool success = sut.TryCreate("abc", 2, 3, out result);

            Assert.True(success);
            Assert.Equal("abc", result.Team);
            Assert.Equal(2, result.GoalsFor);
            Assert.Equal(3, result.GoalsAgainst);
        }