public void ShouldReturnFailedTestWhenWrongMessageIsReturned() { var tests = PactVerifier.VerifyMessages(_messages, (p) => { }, (d) => new { text = "wrong" }); Assert.AreEqual(2, tests.Count); Assert.AreEqual("failed", tests.First().Status); Assert.AreEqual("A message", tests.First().Description); }
public void ShouldReturnSuccessfulTest() { var tests = PactVerifier.VerifyMessages(_messages, (p) => { }, (d) => new { text = "test" }); Assert.AreEqual(2, tests.Count); Assert.AreEqual("passed", tests.First().Status); Assert.AreEqual("A message", tests.First().Description); }
public void ShouldReturnFailedTestWhenMessageProducerThrowsPactVerificationException() { var tests = PactVerifier.VerifyMessages(_messages, (p) => { }, (d) => throw new PactVerificationException("Unknown description.")); Assert.AreEqual(2, tests.Count); Assert.AreEqual("failed", tests.First().Status); Assert.AreEqual("A message", tests.First().Description); Assert.IsTrue(tests.First().Issues.First().Contains("Unknown description.")); }
public void ShouldReturnFailedTestWhenHandlerThrowsPactVerificationException() { var tests = PactVerifier.VerifyMessages(_messages, (p) => throw new PactVerificationException("Unknown provider state."), (d) => new { text = "test" }); Assert.AreEqual(2, tests.Count); Assert.AreEqual("failed", tests.First().Status); Assert.AreEqual("A message", tests.First().Description); Assert.IsTrue(tests.First().Issues.First().Contains("Unknown provider state.")); }