public void TestSearchField(Enums.ResourceType resourceType, string fieldName, string condition) { string resourceName = resourceType.ToResourceName(); string fieldAlias = $"{resourceName}.{fieldName}"; string id1 = SystemFieldTypeHelper.GetRandomResourceId(resourceType, records, recordNum - 1); string id2 = SystemFieldTypeHelper.GetRandomResourceId(resourceType, records, recordNum - 1); Dictionary <string, string> parameters = GetDefaultParameters(fieldAlias, condition); if (SystemTypeField.Id == fieldName) { parameters[DateTimeValidator.ConditionValue1] = id1; parameters[DateTimeValidator.ConditionValue1] = id2; } //Read & verify the field's value SystemFieldTypeHelper.VerifySingleSearchSystemField(resourceType.ToString(), parameters); }
public void TestSearchOrderFieldPhase(List <string> fieldNames, string order) { Enums.ResourceType resourceType = Enums.ResourceType.Client; string id = SystemFieldTypeHelper.GetRandomResourceId(resourceType, records, 3); //Use any ids in created records List <Phase> phaseList = new List <Phase>(); List <string> ids = new List <string>(); for (int i = 1; i <= recordNum; i++) { phaseList.Add(FieldHelper.CreatePhaseInstance(resourceType, id)); ids.AddRange(PublicApiAdapter.CreateAdapterForDefaultConnection().WriteSuccess(phaseList)); } Assume.That(ids, Is.Not.Null.And.Not.Empty, string.Format(Enums.Message.CREATE_RESOURCE_ENTRY_FAILED, resourceType)); Assume.That(ids, Is.All.Not.Null.And.Not.Empty, string.Format(Enums.Message.CREATE_RESOURCE_ENTRY_FAILED, resourceType)); //Read & verify the field's value SystemFieldTypeHelper.VerifyOrderPhaseSystemField(resourceType, fieldNames, order, ids.FirstOrDefault(), recordNum, typeof(DateTime)); }