This commit is contained in:
2020-03-18 19:30:23 +00:00
parent a02d3fee21
commit 41164a04ab

View File

@@ -65,12 +65,6 @@ namespace raven_integration
[Fact] [Fact]
public async void DuplicateUpdateAndDeleteWorks() public async void DuplicateUpdateAndDeleteWorks()
{ {
/*
{
"id": 1,
"name": "CustomTest1"
}
*/
//DUPLICATE //DUPLICATE
dynamic d = new JObject(); dynamic d = new JObject();
@@ -92,15 +86,6 @@ namespace raven_integration
//UPDATE //UPDATE
//Update translation name //Update translation name
/*
{
"id": 10,
"newText": "What the hell?",
"concurrencyToken": 25174
}
*/
dynamic d2 = new JObject(); dynamic d2 = new JObject();
d2.id = NewId; d2.id = NewId;
d2.newText = Util.Uniquify("INTEGRATION-TEST-LOCALE NAME UPDATE"); d2.newText = Util.Uniquify("INTEGRATION-TEST-LOCALE NAME UPDATE");
@@ -137,7 +122,7 @@ namespace raven_integration
DUSER.login = Login; DUSER.login = Login;
DUSER.password = Password; DUSER.password = Password;
DUSER.roles = 0;//norole (any role can get a subset of translation keys) DUSER.roles = 0;//norole (any role can get a subset of translation keys)
DUSER.translationId = NewId; // DUSER.translationId = NewId;
DUSER.userType = 3;//non scheduleable DUSER.userType = 3;//non scheduleable
//Required by form custom rules //Required by form custom rules
DUSER.notes = "notes"; DUSER.notes = "notes";
@@ -147,6 +132,28 @@ namespace raven_integration
long DUSERID = a.ObjectResponse["data"]["id"].Value<long>(); long DUSERID = a.ObjectResponse["data"]["id"].Value<long>();
//RETRIEVE companion USEROPTIONS object
ApiResponse R = await Util.GetAsync("UserOptions/" + DUSERID.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
Util.ValidateDataReturnResponseOk(R);
//ensure the default value is set
R.ObjectResponse["data"]["uiColor"].Value<string>().Should().Be("#000000");
uint concurrencyToken = R.ObjectResponse["data"]["concurrencyToken"].Value<uint>();
//UPDATE
//PUT
dynamic D2 = new JObject();
D2.translationId = NewId;
D2.concurrencyToken = concurrencyToken;
PUTTestResponse = await Util.PutAsync("UserOptions/" + DUSERID.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"), D2.ToString());
Util.ValidateHTTPStatusCode(PUTTestResponse, 200);
//VALIDATE
R = await Util.GetAsync("UserOptions/" + DUSERID.ToString(), await Util.GetTokenAsync("manager", "l3tm3in"));
Util.ValidateDataReturnResponseOk(R);
List<string> keys = new List<string>(); List<string> keys = new List<string>();
keys.AddRange(new string[] { UpdatedTranslationKey }); keys.AddRange(new string[] { UpdatedTranslationKey });