Verifiers appear to always pass

Aug 16, 2010 at 9:55 PM

I have deployed BizMock - Beta - Mar 17 2009.

I am using BizTalk Server 2009.

I am finding that when I use verifiers they succeed even when they should fail. Does anyone know why this might be the case and any possible solution.

For example using the included sample BizMock test RequestSchemaTest I can modify it as follows and it still Passes even though I am checking for a different PostalCode than I set.

[TestMethod]
[DeploymentItem("FileInstances")]
public void RequestSchemaTest()
{
  //set expected message instance postal code value
  Artifacts.Vrf_InboundRequest.PostalCode = "x28850";
  //asserts that the message instance conforms to its expected schema and content (note that we are dynamically changing the value of the message instance)
  Assert.IsTrue(MessageVerifier.Verify(Artifacts.Msg_InboundRequest.ChangePostalCodeTo("y28850").File, Artifacts.Vrf_InboundRequest));
}

Coordinator
Sep 24, 2010 at 5:22 PM

try out the latest version.

i've executed the test you mention and I get a failed test as expected:

MessageVerifier.Verify(Request.xml.d607cb3a-1019-4450-abb5-fdbc559c40e3 failed: Validation failed with exception System.Exception :  expected x28850 at /*[local-name()='Request' and namespace-uri()='http://BizMockSamples.Request']/*[local-name()='PostalCode' and namespace-uri()='']
System.Exception:  expected x28850 at /*[local-name()='Request' and namespace-uri()='http://BizMockSamples.Request']/*[local-name()='PostalCode' and namespace-uri()='']
   at BizMock.XmlMessageVerifierArtifact.validateInnerNode(XmlNode xnode, String xpath, Int32 index, Boolean exactMatch, Boolean innerXml)
   at BizMock.XmlMessageVerifierArtifact.validateInnerNode(XmlDocument xdoc, Boolean exactMatch, Boolean innerXml)
   at BizMock.XmlMessageVerifierArtifact.validateExactInnerText(XmlDocument xdoc)
   at BizMock.CustomMessageVerifierArtifact.<>c__DisplayClass1.<CustomValidation>b__0(IBaseMessage msg)
   at BizMock.MessageExpectation.VerifyValidationDelegates(IBaseMessage message, IList`1 errorList)