示例#1
0
        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);
        }
示例#2
0
        public void DeleteMwiDevice_ErrorResponse_Failure()
        {
            //error response
            _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), It.IsAny <MethodType>(), It.IsAny <ConnectionServerRest>(),
                                                        It.IsAny <string>(), true)).Returns(new WebCallResult
            {
                Success      = false,
                ResponseText = "error text",
                StatusCode   = 404
            });
            var res = Mwi.DeleteMwiDevice(_mockServer, "userObjectId", "Device Name");

            Assert.IsFalse(res.Success, "Calling DeleteMwiDevice with an error response should fail");
        }
示例#3
0
        public void DeleteMwiDevice_InvalidObjectId_Failure()
        {
            var res = Mwi.DeleteMwiDevice(_connectionServer, "UserObjectId", "ObjectId");

            Assert.IsFalse(res.Success, "Static call to DeleteMwiDevice did not fail with: invalid ObjectId");
        }
示例#4
0
        public void DeleteMwiDevice_EmptyObjectId_Failure()
        {
            var res = Mwi.DeleteMwiDevice(_mockServer, "UserOBjectId", "");

            Assert.IsFalse(res.Success, "Calling DeleteMwiDevice with empty objectId should fail");
        }
示例#5
0
        public void DeleteMwiDevice_NullConnectionServer_Failure()
        {
            var res = Mwi.DeleteMwiDevice(null, "UserOBjectId", "ObjectId");

            Assert.IsFalse(res.Success, "Calling DeleteMwiDevice with null connection server should fail");
        }