Exemple #1
0
        public void UpdatePortGroup_ErrorResponse_Failure()
        {
            Reset();
            //error response
            _mockTransport.Setup(x => x.GetCupiResponse(It.IsAny <string>(), MethodType.POST, It.IsAny <ConnectionServerRest>(),
                                                        It.IsAny <string>(), It.IsAny <bool>())).Returns(new WebCallResult
            {
                Success      = false,
                ResponseText = "error text",
                StatusCode   = 404
            });

            ConnectionPropertyList oProps = new ConnectionPropertyList();

            oProps.Add("Test", "test");
            var res = PortGroup.UpdatePortGroup(_mockServer, "PortGroupOBjectId", oProps);

            Assert.IsFalse(res.Success, "Calling UpdatePortGroup with ErrorResponse did not fail");
        }
Exemple #2
0
        public void UpdatePortGroup_EmptyPropList_Failure()
        {
            var res = PortGroup.UpdatePortGroup(_mockServer, "ObjectId", new ConnectionPropertyList());

            Assert.IsFalse(res.Success, "Calling UpdatePortGroup with empty objectId and name should fail.");
        }
Exemple #3
0
        public void UpdatePortGroup_NullConnectionServer_Failure()
        {
            var res = PortGroup.UpdatePortGroup(null, "ObjectId", new ConnectionPropertyList());

            Assert.IsFalse(res.Success, "Calling UpdatePortGroup with null ConnectionServer should fail.");
        }