Example #1
0
        public void NewArtificialIntelligenceShouldCreateOmniscientGodAI()
        {
            //arrange

            //act
            var newAi = TicTacToeFactory.NewArtificialIntelligence(ArtificialIntelligenceTypes.OmniscientGod);

            //assert
            ServiceProviderMock
            .Verify(a => a.GetService(typeof(OmniscientGod)), Times.Once());
        }
Example #2
0
        public void NewArtificialIntelligenceShouldCreateBruteForceAI()
        {
            //arrange

            //act
            var newAi = TicTacToeFactory.NewArtificialIntelligence(ArtificialIntelligenceTypes.BruteForce);

            //assert
            ServiceProviderMock
            .Verify(a => a.GetService(typeof(BruteForce)), Times.Once());
        }
Example #3
0
        public void SmokeTest()
        {
            ServiceProviderMock
            .Setup(sp => sp.GetService(typeof(TestValidator1)))
            .Returns(() => new TestValidator1());

            var provider = new ValidatorProvider(ServiceProviderMock.Object, LoggerMock.Object);
            var result   = provider.GetValidator(nameof(TestValidator1));

            ServiceProviderMock
            .Verify(sp => sp.GetService(typeof(TestValidator1)), Times.Once());

            Assert.IsType <TestValidator1>(result);
        }
Example #4
0
            public void CanGetValidator()
            {
                var validator     = new TestValidator();
                var validatorType = validator.GetType();

                ServiceProviderMock
                .Setup(sp => sp.GetService(validatorType))
                .Returns(() => validator);

                var result = Target.GetValidator(ValidatorUtility.GetValidatorName(validatorType));

                ServiceProviderMock
                .Verify(sp => sp.GetService(validatorType), Times.Once);
                Assert.IsType(validatorType, result);
            }