public void Should_return_bad_request_when_updating_order_with_name_less_than_3_characters() { // arrange var request = (Order)((ICloneable)Request).Clone(); request.Name = GenericLibrary.RandomString(2); // act var apiResponse = httpService.PerformPut(request, request.Id); // assert StatusCodeShouldBe(apiResponse, HttpStatusCode.BadRequest, "Order Name length should be between 3 and 1000 characters"); }
public void Should_return_bad_request_for_name_greater_than_512_characters() { // arrange var request = GetValidRequest(); request.Name = GenericLibrary.RandomString(513); //act var apiResponse = httpService.PerformPost(request); // assert StatusCodeShouldBe(apiResponse, HttpStatusCode.BadRequest, "Product Name should be between 3 and 512"); }
public void Should_return_bad_request_when_creating_agency_order_with_name_greater_than_1000_characters() { // arrange var request = GetValidRequest(); request.Name = GenericLibrary.RandomString(1001); // act var apiResponse = httpService.PerformPost(request); // assert StatusCodeShouldBe(apiResponse, HttpStatusCode.BadRequest, "Order Name length should be between 3 and 1000 characters"); }
private OrderItemType GetNewOrderItemType() { var orderItemTypeRequest = new OrderItemType { Name = "AutomationOrderItem", IsDisabled = false, Url = "https://www.test.com", Key = GenericLibrary.RandomString(10), InitialStatus = "ReadyToBook" }; var automationVariables = AppSettingsInitialization.GetConfigInstance(); httpService.EndPoint = automationVariables.OrderItemTypeAPI; var orderItemTypeResponse = httpService.PerformPost(orderItemTypeRequest); var response = JSONLibrary.DeserializeJSon <OrderItemType>(orderItemTypeResponse.Content); orderItemTypeRequest.Id = response.Id; return(orderItemTypeRequest); }