Exemple #1
0
        public void DeletePortGroupServer_ErrorResponse_Failure()
        {
            BaseUnitTests.Reset();
            _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
            });

            ConnectionPropertyList oProps = new ConnectionPropertyList();

            oProps.Add("Test", "Test");
            var res = PortGroupServer.DeletePortGroupServer(_mockServer, "ObjectId", "PortGroupObjectId");

            Assert.IsFalse(res.Success, "Calling DeletePortGroupServer with ErrorResponse did not fail");
        }
Exemple #2
0
        public void DeletePortGroupServer_NullConnectionServer_Failure()
        {
            var res = PortGroupServer.DeletePortGroupServer(null, "objectid", "portgroupobjectid");

            Assert.IsFalse(res.Success, "Static call to DeletePortGroupServer did not fail with null ConnectionServer");
        }
Exemple #3
0
        public void DeletePortGroupServer_EmptyPortGroupObjectId_Failure()
        {
            var res = PortGroupServer.DeletePortGroupServer(_mockServer, "bogus", "");

            Assert.IsFalse(res.Success, "Static call to DeletePortGroupServer did not fail with empty PortGroupObjectId");
        }
        public void DeletePortGroupServer_InvalidPortGropObjectId_Failure()
        {
            var res = PortGroupServer.DeletePortGroupServer(_connectionServer, "bogus", "bogus");

            Assert.IsFalse(res.Success, "Static call to DeletePortGroupServer did not fail with an invalid PortGroupObjectId");
        }