private void PerformSingleKeywordTest(Enums.ResourceType resource, KeywordInputType inputType, ulong expectedRecordId) { var adapter = PublicApiAdapter.CreateAdapterForDefaultConnection(); var records = adapter.ReadSuccess((resource.ToString()).ToString(), new Dictionary <string, object> { ["partition"] = AuthenticationInfoProvider.Current.DefaultPartition, ["keywords"] = KeywordHelper.KeywordInput[inputType], ["count"] = 200 //max count }); Assert.That(records, Is.Not.Null, "Search request was not successful"); Assert.That(records.Code, Is.EqualTo(Enums.PublicAPIResultCode.Success), "Search response code is not success"); Assert.That(records.Items?.Select(x => x.DictionaryValues[$"{resource.ToPrivateEnum()}.P_Id"]), Has.Exactly(1).EqualTo(expectedRecordId.ToString())); }
public KeywordInput(KeywordInputType type, string label, string helpText) { _inputType = type; _label = label; _helpText = helpText; }
private static string GetFieldValue(string fieldName, KeywordInputType inputType) { return(KeywordHelper.KeywordInput[inputType] + (fieldName.Contains("Mail") ? "@mail.com" : "")); }
public void TestSingleKeywordUserDefinedField(Enums.ResourceType resource, FieldType fieldType, KeywordInputType inputType) { var expectedRecordId = UserFieldsRecordCreator.Data.Single(x => (x.Key is RecordDescriptor) && ((RecordDescriptor)x.Key).Resource == resource && ((RecordDescriptor)x.Key).FieldName == FieldCreator.Data[$"{resource} {fieldType}"].Name && ((RecordDescriptor)x.Key).FieldValue == inputType).Value.Id; PerformSingleKeywordTest(resource, inputType, expectedRecordId); }
public void TestSingleKeywordApplicationField(Enums.ResourceType resource, string fieldName, KeywordInputType inputType) { var expectedRecordId = ApplicationFieldsRecordCreator.Data.Single(x => (x.Key is RecordDescriptor) && ((RecordDescriptor)x.Key).Resource == resource && ((RecordDescriptor)x.Key).FieldName == fieldName && ((RecordDescriptor)x.Key).FieldValue == inputType).Value.Id; PerformSingleKeywordTest(resource, inputType, expectedRecordId); }