public void NewArtificialIntelligenceShouldCreateOmniscientGodAI() { //arrange //act var newAi = TicTacToeFactory.NewArtificialIntelligence(ArtificialIntelligenceTypes.OmniscientGod); //assert ServiceProviderMock .Verify(a => a.GetService(typeof(OmniscientGod)), Times.Once()); }
public void NewArtificialIntelligenceShouldCreateBruteForceAI() { //arrange //act var newAi = TicTacToeFactory.NewArtificialIntelligence(ArtificialIntelligenceTypes.BruteForce); //assert ServiceProviderMock .Verify(a => a.GetService(typeof(BruteForce)), Times.Once()); }
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); }
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); }