public void ThrowsArgumentNullExceptionForNullValidator() { var compositeValidatorProvider = new CompositeValidatorProvider(); ExceptionTester.CallMethodAndExpectException <ArgumentNullException>( () => compositeValidatorProvider.Remove(null)); }
public void EliminatesAnAlreadyAddedValidator() { var compositeValidatorProvider = new CompositeValidatorProvider(); var validatorProviderMock1 = new Moq.Mock <IValidatorProvider>(); var validatorProviderMock2 = new Moq.Mock <IValidatorProvider>(); compositeValidatorProvider.Add(validatorProviderMock1.Object); compositeValidatorProvider.Add(validatorProviderMock2.Object); compositeValidatorProvider.Remove(validatorProviderMock1.Object); Assert.IsFalse(compositeValidatorProvider.Contains(validatorProviderMock1.Object)); }