Skip to content

Commit

Permalink
If the manufacturing state is blank, expect a device error; otherwise…
Browse files Browse the repository at this point in the history
…, expect identity operation. (#18)
  • Loading branch information
cawhitworth committed Jan 15, 2024
1 parent 77577c6 commit d9d35c9
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ public void SetManufacturingState_SetManufacturingStateAsCurrent_ReturnsCurrentS
string startGetResponse = Manufacturing.GetManufacturingState();
string currentState = JsonConvert.DeserializeObject<Dictionary<string, string>>(startGetResponse)["manufacturingState"];

string setResponse = Manufacturing.SetDeviceManufacturingState(currentState);

Assert.AreEqual("{}", setResponse);
if (currentState == "Blank") {
// It is invalid to try and set a device to manufacturing state "Blank", so we expect an error in this case
DeviceError error = Assert.ThrowsException<DeviceError>( () => Manufacturing.SetDeviceManufacturingState(currentState));
} else {
string setResponse = Manufacturing.SetDeviceManufacturingState(currentState);
Assert.AreEqual("{}", setResponse);
}

string endGetResponse = Manufacturing.GetManufacturingState();

Expand Down

0 comments on commit d9d35c9

Please sign in to comment.