Exemple #1
0
        public void GetMonthlyBandwidthReturnsBandwidth()
        {
            var client            = new cPanelClient(_username, _hostname, password: _password, cpanel: true);
            var bandwidthResponse = client.Api2("Stats", "getmonthlybandwidth");

            Assert.IsTrue(bandwidthResponse.Length > 0);
        }
Exemple #2
0
        public void GetEmailsByRegexReturnsEmails()
        {
            var client            = new cPanelClient(_username, _hostname, password: _password, cpanel: true);
            var emailListResponse = client.Api2("Email", "listpops", param: new { regex = "pr" });

            Assert.IsTrue(emailListResponse.Length > 0);
        }
        public CPanelCommunicator(String username, String password, String host) : this()
        {
            this.username = username;
            this.password = password;
            this.host     = host;

            client = new cPanelClient(username, host, password: password, cpanel: true);
        }
Exemple #4
0
        public void NoModuleThrowsException()
        {
            var client = new cPanelClient(_username, _hostname, password: _password);

            client.Api2("", "fooFunc");
        }
Exemple #5
0
        public void NoFunctionThrowsException()
        {
            var client = new cPanelClient(_username, _hostname, password: _password, cpanel: true);

            client.Api2("fooModule", "");
        }
Exemple #6
0
        public void WhmAndNoUserThrowsException()
        {
            var client = new cPanelClient(_username, _hostname, accessHash: "foo");

            client.Api2("fooModule", "fooFunc");
        }
Exemple #7
0
        public void ValidCredsCreatesClient()
        {
            var client = new cPanelClient(_username, _hostname, password: _password, cpanel: true);

            Assert.IsNotNull(client);
        }
Exemple #8
0
 public void CpanelAndAccessHashThrowsException()
 {
     var client = new cPanelClient(_username, _hostname, accessHash: "foo", cpanel: true);
 }
Exemple #9
0
 public void BothPwAndAccessHashNotEmptyThrowsException()
 {
     var client = new cPanelClient(_username, _hostname, password: _password, accessHash: "foo");
 }
Exemple #10
0
 public void PwAndAccessHashEmptyThrowsException()
 {
     var client = new cPanelClient(_username, _hostname);
 }