4648
This commit is contained in:
@@ -67,45 +67,6 @@ namespace raven_integration
|
|||||||
templateArray.Count.Should().Be(3);
|
templateArray.Count.Should().Be(3);
|
||||||
templateArray[2]["fld"].Value<string>().Should().Be("CustomerAccountNumber");
|
templateArray[2]["fld"].Value<string>().Should().Be("CustomerAccountNumber");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// {
|
|
||||||
// "id": 0,
|
|
||||||
// "concurrency": 0,
|
|
||||||
// "name": "ATestCustomer",
|
|
||||||
// "active": true,
|
|
||||||
// "notes": null,
|
|
||||||
// "wiki": null,
|
|
||||||
// "customFields": "{}",
|
|
||||||
// "tags": [],
|
|
||||||
// "webAddress": null,
|
|
||||||
// "alertNotes": null,
|
|
||||||
// "billHeadOffice": false,
|
|
||||||
// "headOfficeId": null,
|
|
||||||
// "techNotes": null,
|
|
||||||
// "accountNumber": "AUniqueAccountNumber",
|
|
||||||
// "contractId": null,
|
|
||||||
// "contractExpires": null,
|
|
||||||
// "phone1": null,
|
|
||||||
// "phone2": null,
|
|
||||||
// "phone3": null,
|
|
||||||
// "phone4": null,
|
|
||||||
// "phone5": null,
|
|
||||||
// "emailAddress": null,
|
|
||||||
// "postAddress": null,
|
|
||||||
// "postCity": null,
|
|
||||||
// "postRegion": null,
|
|
||||||
// "postCountry": null,
|
|
||||||
// "postCode": null,
|
|
||||||
// "address": null,
|
|
||||||
// "city": null,
|
|
||||||
// "region": null,
|
|
||||||
// "country": null,
|
|
||||||
// "addressPostal": null,
|
|
||||||
// "latitude": null,
|
|
||||||
// "longitude": null
|
|
||||||
// }
|
|
||||||
|
|
||||||
//CONFIRM THE CUSTOM PICKLIST TEMPLATE WORKS PROPERLY
|
//CONFIRM THE CUSTOM PICKLIST TEMPLATE WORKS PROPERLY
|
||||||
//MAKE THE TEST Customer
|
//MAKE THE TEST Customer
|
||||||
//make a unique string for this iteration of this test only
|
//make a unique string for this iteration of this test only
|
||||||
@@ -114,22 +75,13 @@ namespace raven_integration
|
|||||||
d.name = Util.Uniquify("CustomerPickListTemplatesOps") + UniquePhrase;
|
d.name = Util.Uniquify("CustomerPickListTemplatesOps") + UniquePhrase;
|
||||||
d.active = true;
|
d.active = true;
|
||||||
d.accountNumber = UniquePhrase;
|
d.accountNumber = UniquePhrase;
|
||||||
// d.login = Util.Uniquify("LOGIN");
|
|
||||||
// d.password = Util.Uniquify("PASSWORD");
|
|
||||||
// d.roles = 0;//norole
|
|
||||||
|
|
||||||
// d.userType = 3;//non scheduleable
|
|
||||||
// //Required by form custom rules
|
|
||||||
// d.notes = "notes";
|
|
||||||
//d.customFields = Util.UserRequiredCustomFieldsJsonString();
|
|
||||||
|
|
||||||
a = await Util.PostAsync("Customer", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
a = await Util.PostAsync("Customer", await Util.GetTokenAsync("superuser", "l3tm3in"), d.ToString());
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
long ExpectedObjectId = a.ObjectResponse["data"]["id"].Value<long>();
|
long ExpectedObjectId = a.ObjectResponse["data"]["id"].Value<long>();
|
||||||
|
|
||||||
|
|
||||||
//GET PICKLIST FOR unique phrase query sb only employee number due to custom template
|
//GET PICKLIST FOR unique phrase query sb only employee number due to custom template
|
||||||
a = await Util.PostAsync("pick-list/list", await Util.GetTokenAsync("BizAdmin"),$"{{\"ayaType\":8,\"query\":\"{UniquePhrase}\"}}");
|
a = await Util.PostAsync("pick-list/list", await Util.GetTokenAsync("BizAdmin"), $"{{\"ayaType\":8,\"query\":\"{UniquePhrase}\"}}");
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
var pickList = ((JArray)a.ObjectResponse["data"]);
|
var pickList = ((JArray)a.ObjectResponse["data"]);
|
||||||
pickList.Count.Should().Be(1);
|
pickList.Count.Should().Be(1);
|
||||||
@@ -139,7 +91,6 @@ namespace raven_integration
|
|||||||
a = await Util.DeleteAsync("User/" + ExpectedObjectId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
a = await Util.DeleteAsync("User/" + ExpectedObjectId.ToString(), await Util.GetTokenAsync("superuser", "l3tm3in"));
|
||||||
Util.ValidateHTTPStatusCode(a, 204);
|
Util.ValidateHTTPStatusCode(a, 204);
|
||||||
|
|
||||||
|
|
||||||
// RESET TEMPLATE TO DEFAULT
|
// RESET TEMPLATE TO DEFAULT
|
||||||
//Note deleting causes server to replace with default
|
//Note deleting causes server to replace with default
|
||||||
a = await Util.DeleteAsync($"pick-list/template/{AY_OBJECT_TYPE_CUSTOMER}/", await Util.GetTokenAsync("BizAdmin"));
|
a = await Util.DeleteAsync($"pick-list/template/{AY_OBJECT_TYPE_CUSTOMER}/", await Util.GetTokenAsync("BizAdmin"));
|
||||||
@@ -208,7 +159,6 @@ namespace raven_integration
|
|||||||
Util.ValidateErrorCodeResponse(a, 2200, 400);
|
Util.ValidateErrorCodeResponse(a, 2200, 400);
|
||||||
Util.ShouldContainValidationError(a, "Template", "2201");
|
Util.ShouldContainValidationError(a, "Template", "2201");
|
||||||
|
|
||||||
|
|
||||||
//MALFORMED TEMPLATE JSON ERROR
|
//MALFORMED TEMPLATE JSON ERROR
|
||||||
d = new JObject();
|
d = new JObject();
|
||||||
d.Id = AY_OBJECT_TYPE_CUSTOMER;
|
d.Id = AY_OBJECT_TYPE_CUSTOMER;
|
||||||
@@ -234,10 +184,10 @@ namespace raven_integration
|
|||||||
//RETRIEVE
|
//RETRIEVE
|
||||||
ApiResponse a = await Util.GetAsync("pick-list/template/list", await Util.GetTokenAsync("BizAdmin"));
|
ApiResponse a = await Util.GetAsync("pick-list/template/list", await Util.GetTokenAsync("BizAdmin"));
|
||||||
Util.ValidateDataReturnResponseOk(a);
|
Util.ValidateDataReturnResponseOk(a);
|
||||||
//assert contains at least two records (as we only have two at time of writing this test)
|
//assert contains at least 16 records at time of writing this test
|
||||||
var templateList = ((JArray)a.ObjectResponse["data"]);
|
var templateList = ((JArray)a.ObjectResponse["data"]);
|
||||||
templateList.Count.Should().BeGreaterThan(1);
|
templateList.Count.Should().BeGreaterThan(16);
|
||||||
templateList[0]["id"].Value<long>().Should().Be(2);//first one should be a user
|
templateList[0]["id"].Value<long>().Should().Be(10);//first one should be a contract
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user