コード例 #1
0
        public void Connect_WhenCredentialsNull_ThrowsArgumentNullException()
        {
            IServerConnectionService connection = new PowerShellConnectionService();

            connection.Connect(new ServerConnection
            {
                Credential = null,
                Host       = "tatata"
            });
        }
コード例 #2
0
        public void Connect_WhenHostDoesNotExist_ThrowsServerConnectionException()
        {
            IServerConnectionService connection = new PowerShellConnectionService();

            connection.Connect(new ServerConnection
            {
                Credential = new ServerCredential
                {
                    Username = "******"
                },
                Host = "tatata"
            });
        }
コード例 #3
0
        public void Connect_WhenUsernameNull_ThrowsArgumentNullException()
        {
            IServerConnectionService connection = new PowerShellConnectionService();

            connection.Connect(new ServerConnection
            {
                Credential = new ServerCredential
                {
                    Username = null
                },
                Host = "10.1.10.1"
            });
        }
コード例 #4
0
        public void Connect_WhenHostNull_ThrowsArgumentNullException()
        {
            IServerConnectionService connection = new PowerShellConnectionService();

            connection.Connect(new ServerConnection
            {
                Credential = new ServerCredential
                {
                    Username = "******"
                },
                Host = null
            });
        }
コード例 #5
0
        public void Connect_WhenInvalidUsername_ThrowsServerConnectionException()
        {
            IServerConnectionService connection = new PowerShellConnectionService();

            connection.Connect(new ServerConnection
            {
                Credential = new ServerCredential
                {
                    Username = "******"
                },
                Host = "10.1.10.1"
            });
        }
コード例 #6
0
        public void Connect_WhenInvalidPassword_ThrowsServerConnectionException()
        {
            IServerConnectionService connection = new PowerShellConnectionService();

            connection.Connect(new ServerConnection
            {
                Credential = new ServerCredential
                {
                    Username = "******",
                    Password = "******"
                },
                Host = "10.1.10.1"
            });
        }
コード例 #7
0
        public void Connect_WhenConnectionTimeOut_ThrowsWindowsOperationTimeoutException()
        {
            IServerConnectionService connection = new PowerShellConnectionService();

            connection.Connect(new ServerConnection
            {
                Credential = new ServerCredential
                {
                    Username = "******",
                    Password = null
                },
                Host    = "10.1.10.1",
                Timeout = TimeSpan.Zero
            });
        }
コード例 #8
0
        public void Connect_WhenValidUserAndPassword_IsConnected()
        {
            IServerConnectionService connection = new PowerShellConnectionService();

            connection.Connect(new ServerConnection
            {
                Credential = new ServerCredential
                {
                    Username = "******",
                    Password = ""
                },
                Host = "10.1.10.1",
                Port = 443
            });

            Assert.IsTrue(connection.IsConnected);
        }