Skip to content

Instantly share code, notes, and snippets.

@obegendi
Created July 21, 2019 16:33
Show Gist options
  • Save obegendi/5ddc0a6a6f557b197d013b7f8e5e6bc9 to your computer and use it in GitHub Desktop.
Save obegendi/5ddc0a6a6f557b197d013b7f8e5e6bc9 to your computer and use it in GitHub Desktop.
[Fact]
public void SendToBranchWhenIsValidException()
{
//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"));
var sut = new CreditApplicationEvaluator(mockValidator.Object);
var application = new CreditApplication { Age = 42 };
//Act
CreditApplicationDecision decision = sut.Evaluate(application);
//Assert
Assert.Equal(CreditApplicationDecision.BranchFlow, decision);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment