Created
July 21, 2019 16:38
-
-
Save obegendi/14a63e9e5b5a1500378f2ef5101a56e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void SendMessageToAlertQueueWhenIsValidException() | |
{ | |
//Arrange | |
Mock<IValidator> mockValidator | |
= new Mock<IValidator>(); | |
mockValidator.Setup(x => x.ServiceStatus).Returns(Status.NotOK); | |
mockValidator.Setup(x => x.IsValid(It.IsAny<string>())) | |
.Throws(new Exception("Some exception Message")) | |
.Raises(x => x.PublishToQueue += null, EventArgs.Empty);; | |
var sut = new CreditApplicationEvaluator(mockValidator.Object); | |
var application = new CreditApplication { Age = 42 }; | |
//Act | |
CreditApplicationDecision decision = sut.Evaluate(application); | |
//mockValidator.Raise(x => x.PublishToQueue += null, EventArgs.Empty); | |
//Assert | |
Assert.Equal(1, sut.ValidatorQueueEvent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment