This commit is contained in:
2018-09-25 18:28:56 +00:00
parent cb3d5105b5
commit 1d1fc8dfc8

View File

@@ -91,17 +91,58 @@ namespace raven_integration
MatchingIdList.Add(j["id"].Value<long>());
}
//Ensure the expected items are returned
MatchingIdList.Should().Contain(MatchFirstWidgetId, "ShouldContainFirstWidget");
MatchingIdList.Should().Contain(MatchSecondWidgetId, "ShouldContainSecondWidget");
MatchingIdList.Should().Contain(MatchUserId, "ShouldContainUser");
MatchingIdList.Should().NotContain(NoMatchThirdWidgetId, "ShouldNotContainThirdWidget");
//Assert the order, the first item should be a lower object type than the last item, the first should be
//Assert the order (roughly, this is kind of a waste of time, either the code is sorting or not, it's not going to change)
//first item must be a widget
a.ObjectResponse["result"][0]["type"].Value<int>().Should().Be(2);
//final item must be a user
a.ObjectResponse["result"][MatchingIdList.Count - 1]["type"].Value<int>().Should().Be(3);
}//eot
/*
{{
"result": [
{
"name": "Search simple as in dogs SECOND Test WIDGET1537899693",
"type": 2,
"id": 205
},
{
"name": "Search Simple Test WIDGET1537899693",
"type": 2,
"id": 204
},
{
"name": "Search simple as in dogs SECOND Test WIDGET1537899490",
"type": 2,
"id": 202
},
{
"name": "Search Simple Test WIDGET1537899489",
"type": 2,
"id": 201
},
{
"name": "Search simple Test User1537899693",
"type": 3,
"id": 22
},
{
"name": "Search simple Test User1537899490",
"type": 3,
"id": 21
}
]
}}
*/