Esempio n. 1
0
        public void Update_NoPendingChanges_Failure()
        {
            AlternateExtension oAltExt = new AlternateExtension();
            var res = oAltExt.Update(true);

            Assert.IsFalse(res.Success, "Calling Update with no pending changes should fail");
        }
Esempio n. 2
0
        public void Update_ErrorResponse_Failure()
        {
            //error response
            _mockTransport.Setup(
                x => x.GetCupiResponse(It.IsAny <string>(), It.IsAny <MethodType>(), It.IsAny <ConnectionServerRest>(),
                                       It.IsAny <string>(), It.IsAny <bool>())).Returns(new WebCallResult
            {
                Success      = false,
                ResponseText = "dummy text",
                StatusCode   = 444
            });

            AlternateExtension oAltExt = new AlternateExtension(_mockServer, "UserObjectId");

            oAltExt.DisplayName = "updated display name";
            var res = oAltExt.Update(true);

            Assert.IsFalse(res.Success, "Calling update with an error response should fail:" + res);
            Assert.IsTrue(res.StatusCode == 444, "Status code returned from updated call did not match error code issues in moq:" + res.StatusCode);
        }