mardi 25 février 2020

How to compare a input value to value in results

This is my input

{
  "AccountId": "9834e8cb-275a-4bff-b362-f216e9653686",
  "ContactId": "9834e8cb-275a-4bff-b362-f216e9653686",
  "AuthenticationDetails": {
    "AuthenticationId": "",
    "AuthenticationType": "Token"
  }
}

This is my output

{
    "orderedByContactId": "36b8e4da-94fd-4680-a2d3-6b128e4b2584",
    "orderedForContactId": "9834e8cb-275a-4bff-b362-f216e9653686"
}

I need to create a test (postman) to ensure that the output value ("orderedForContactId") matches the input value ("ContactId"). Can someone help me out?

Existing tests are in the following format:

pm.test("Response should contain orderedForContactId",function(){
    let jsonRespData = pm.response.json();

    pm.expect(jsonRespData).to.have.property('orderedForContactId');
});

Aucun commentaire:

Enregistrer un commentaire