Beispiel #1
0
        public void GetPortGroup_EmptyObjectIdAndName_Failure()
        {
            PortGroup oPortGroup;

            var res = PortGroup.GetPortGroup(out oPortGroup, _mockServer, "");

            Assert.IsFalse(res.Success, "Fetching port group with empty objectId and name should fail.");
        }
Beispiel #2
0
        public void GetPortGroup_NullConnectionServer_Failure()
        {
            PortGroup oPortGroup;

            var res = PortGroup.GetPortGroup(out oPortGroup, null, "ObjectId");

            Assert.IsFalse(res.Success, "Fetching port group with null Connection server should fail.");
        }
Beispiel #3
0
        public void GetPortGroup_ErrorResponse_Failure()
        {
            Reset();
            //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
            });

            PortGroup oPortGroup;
            var       res = PortGroup.GetPortGroup(out oPortGroup, _mockServer, "objectId");

            Assert.IsFalse(res.Success, "Calling GetPortGroup with ErrorResponse did not fail");
        }