public void SearchValidOperatorTests(ResourceId resourceId, SearchFilterType searchFilterType, FieldCategories fieldType) { var request = SearchRequestMapper[searchFilterType](resourceId, fieldType.ToString(), SearchValue); PerformSuccessfulSearchTest(resourceId, request, fieldType); }
private void PerformSuccessfulSearchTest(ResourceId resource, SearchRequest request, FieldCategories fieldType) { var expectedId = new Dictionary <string, ulong>() { [FieldCategories.SystemField.ToString()] = SystemRecord.Data[resource].Id, [FieldCategories.UserField.ToString()] = UserRecord.Data[resource].Id }; var manager = new DefaultManager(); var response = manager.Send <SearchResponse>(request); PrAssert.That(response, PrIs.SuccessfulResponse <SearchResponse>()); PrAssert.That(response.Result.Status, PrIs.EqualTo("OK")); if (response.Result.Total == 0) { PrAssert.That(response.Result.Items, Has.No.Member((int)expectedId[fieldType.ToString()])); } else { PrAssert.That(response.Result.Items, Has.Member((int)expectedId[fieldType.ToString()])); } }