Exemple #1
0
        public void Delete_ErrorResponse_Failure()
        {
            PortGroupServer oServer = new PortGroupServer(_mockServer, "PortGroupObjectId");

            _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.DELETE, It.IsAny <ConnectionServerRest>(),
                                                        It.IsAny <string>(), true)).Returns(new WebCallResult
            {
                Success      = false,
                ResponseText = "error text",
                StatusCode   = 404
            });
            var res = oServer.Delete();

            Assert.IsFalse(res.Success, "Calling Delete with an error response should fail");
        }