public void GetMwiDevice_InvalidOBjectId_Failure() { Mwi oMwiDevice; var res = Mwi.GetMwiDevice(_connectionServer, "UserObjectId", "ObjectId", out oMwiDevice); Assert.IsFalse(res.Success, "Static call to GetMwiDevice did not fail with: invalid ObjectId"); }
public void AddEditDeleteMwi_Success() { var res = Mwi.AddMwi(_connectionServer, _tempUser.ObjectId, "display name", _tempUser.MediaSwitchObjectId, "1234321", false); Assert.IsTrue(res.Success, "Failed to create MWI device for user:"******"Failed to fetch single MWI device just added for user:"******"Calling update on MWi device with no pending changes did not fail"); oMwiDevice.DisplayName = "Updated Display Name"; oMwiDevice.Active = false; res = oMwiDevice.Update(); Assert.IsTrue(res.Success, "Updating MWI properties failed:" + res); Thread.Sleep(2000); List <Mwi> oMwis; res = Mwi.GetMwiDevices(_connectionServer, _tempUser.ObjectId, out oMwis); Assert.IsTrue(res.Success, "Failed to fetch MWI device for user:"******"Mwi count is not at least 2 after adding device, instead its" + oMwis.Count); res = Mwi.DeleteMwiDevice(_connectionServer, _tempUser.ObjectId, oMwiDevice.ObjectId); Assert.IsTrue(res.Success, "Failed to delete MWI device for user:" + res); }
public void GetMwiDevice_NullConnectionServer_Failure() { Mwi oMwi; var res = Mwi.GetMwiDevice(null, "UserObjectId", "ObjectId", out oMwi); Assert.IsFalse(res.Success, "Calling GetMwiDevice with null connection server should fail"); }
public void GetMwiDevice_EmptyObjectId_Failure() { Mwi oMwi; var res = Mwi.GetMwiDevice(_mockServer, "UserObjectId", "", out oMwi); Assert.IsFalse(res.Success, "Calling GetMwiDevice with empty objectId should fail"); }
public void GetMwiDevice_ErrorResponse_Failure() { //error response _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.GET, It.IsAny <ConnectionServerRest>(), It.IsAny <string>(), true)).Returns(new WebCallResult { Success = false, ResponseText = "error text", StatusCode = 404 }); Mwi oMwi; var res = Mwi.GetMwiDevice(_mockServer, "userObjectId", "ObjectId", out oMwi); Assert.IsFalse(res.Success, "Calling GetMwiDevice with an error response should fail"); }