예제 #1
0
        public void AddDirectoryHandler_NullConnectionServer_Failure()
        {
            DirectoryHandler oHandler;
            var res = DirectoryHandler.AddDirectoryHandler(null, "display name", true, null, out oHandler);

            Assert.IsFalse(res.Success, "Calling AddHandler with null ConnectionServerRest did not fail");
        }
예제 #2
0
        public void AddDirectoryHandler_EmptyDisplayName_Failure()
        {
            DirectoryHandler oHandler;
            var res = DirectoryHandler.AddDirectoryHandler(_mockServer, "", true, null, out oHandler);

            Assert.IsFalse(res.Success, "Calling AddHandler with empty display name did not fail");
        }
예제 #3
0
        public new static void MyClassInitialize(TestContext testContext)
        {
            BaseIntegrationTests.MyClassInitialize(testContext);

            //create new handler with GUID in the name to ensure uniqueness
            String strName = "TempHandler_" + Guid.NewGuid().ToString().Replace("-", "");

            WebCallResult res = DirectoryHandler.AddDirectoryHandler(_connectionServer, strName, false, null, out _tempHandler);

            Assert.IsTrue(res.Success, "Failed creating temporary directory handler:" + res.ToString());
        }
예제 #4
0
        public void AddDirectoryHandler_ErrorResponse_Failure()
        {
            Reset();
            _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
            });

            var res = DirectoryHandler.AddDirectoryHandler(_mockServer, "Display Name", false, null);

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