public void ValidCreateMenuTest(ResourceId resource, SublistMenuTestData.LabelValue labelValue, MainMenuTestData.Condition condition, MainMenuTestData.Alias alias, MainMenuTestData.Join join) { var handler = new DefaultManager(); var requestJson = GetCreateMenuRequest((int)resource, GetLabelValue(SublistMenuTestData.ValidLabelMapper[labelValue])); requestJson["conditions"] = GetConditionValue($"{resource.ToAlias()}.{MainMenuTestData.ValidAliasMapper[alias]("")}", join.ToString().ToUpper(), new List()); var createResponse = handler.SendAsync <CreateMenuResponse>(SublistMenuTestData.MenuEndPoint, requestJson.ToJson(), HttpMethod.POST).Result; PrAssert.That(createResponse, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK), "Not able to create a menu"); PrAssert.That(createResponse.Result.Id, PrIs.Not.Null.And.Not.Empty, "Not able to create a menu"); }
public void ValidUpdateMenuTest(ResourceId resource, SublistMenuTestData.LabelValue labelValue, MainMenuTestData.Condition condition, MainMenuTestData.Alias alias, MainMenuTestData.Join join) { var handler = new DefaultManager(); var requestJson = GetUpdateMenuRequest(SublistMenuTestData.ValidMenuIdMapper[resource], (int)resource, GetLabelValue(SublistMenuTestData.ValidLabelMapper[labelValue])); requestJson["conditions"] = GetConditionValue($"{resource.ToAlias()}.{MainMenuTestData.ValidAliasMapper[alias]("")}", join.ToString().ToUpper(), new List()); var updateResponse = handler.SendAsync <object>(SublistMenuTestData.MenuEndPoint, requestJson.ToJson(), HttpMethod.PUT).Result; PrAssert.That(updateResponse, PrIs.SuccessfulResponse(), "Not able to update a menu"); }