コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: mjknowles/kata04
        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);
        }
コード例 #3
0
        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);
        }