public void GetMonthlyBandwidthReturnsBandwidth() { var client = new cPanelClient(_username, _hostname, password: _password, cpanel: true); var bandwidthResponse = client.Api2("Stats", "getmonthlybandwidth"); Assert.IsTrue(bandwidthResponse.Length > 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); }
public void NoModuleThrowsException() { var client = new cPanelClient(_username, _hostname, password: _password); client.Api2("", "fooFunc"); }
public void NoFunctionThrowsException() { var client = new cPanelClient(_username, _hostname, password: _password, cpanel: true); client.Api2("fooModule", ""); }
public void WhmAndNoUserThrowsException() { var client = new cPanelClient(_username, _hostname, accessHash: "foo"); client.Api2("fooModule", "fooFunc"); }
public void ValidCredsCreatesClient() { var client = new cPanelClient(_username, _hostname, password: _password, cpanel: true); Assert.IsNotNull(client); }
public void CpanelAndAccessHashThrowsException() { var client = new cPanelClient(_username, _hostname, accessHash: "foo", cpanel: true); }
public void BothPwAndAccessHashNotEmptyThrowsException() { var client = new cPanelClient(_username, _hostname, password: _password, accessHash: "foo"); }
public void PwAndAccessHashEmptyThrowsException() { var client = new cPanelClient(_username, _hostname); }