public void TestUpdateInvalidSpecialProperties(ResourceId resource, FieldTypes fType, InvalidUpdateSpecial propName) { var guid = TextHelpers.Guid[fType](resource, FieldsCreator, Defines.FieldTypeApi, ApplicationFieldNames[Defines.FieldTypeApi]().First()); var handler = new DefaultManager(); var request = GenerateUpdateRequest(resource, guid.ToString(), GenerateExceptedProperties(Defines.FieldTypeApi, propName.GetEnumStringValue(), UpdateInvalidSpecialMappingValue[propName])); var response = handler.Send <object>(FieldManager.FieldHandlingRelativeUrl, JsonConvert.SerializeObject(request), TestCoreFramework.Enums.HttpMethod.PUT); PrAssert.That(response, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest)); }
public void TestUpdateValidSpecialProperties(ResourceId resource, FieldTypes fType, Properties.PropertyName propName) { var guid = TextHelpers.Guid[fType](resource, FieldsCreator, Defines.FieldTypeApi, ApplicationFieldNames[Defines.FieldTypeApi]().First()); var handler = new DefaultManager(); var request = GenerateUpdateRequest(resource, guid.ToString(), GenerateExceptedProperties(Defines.FieldTypeApi, propName.GetEnumStringValue(), SpecialMappingValue[propName])); var response = handler.Send <object>(FieldManager.FieldHandlingRelativeUrl, JsonConvert.SerializeObject(request), TestCoreFramework.Enums.HttpMethod.PUT); PrAssert.That(response, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.NoContent)); var result = (new FieldManager()).GetFieldDetails(guid); if (propName == Properties.PropertyName.Enabled) { PrAssert.That(result.Result.Values.SingleOrDefault().Key.ToString(), PrIs.Not.EqualTo(propName.GetEnumStringValue())); } else { PrAssert.That(result.Result.Values.SingleOrDefault().Value.Properties[propName.GetEnumStringValue()], PrIs.Not.EqualTo(SpecialMappingValue[propName])); } }