public void CreatePptp() { using (var sshNewServer = new Majorsilence.Vpn.Logic.Ssh.FakeSsh()) using (var sshRevokeServer = new Majorsilence.Vpn.Logic.Ssh.FakeSsh()) { var ppt = new Majorsilence.Vpn.Logic.Ppp.ManagePPTP(2, 1, sshNewServer, sshRevokeServer); ppt.AddUser(); } }
public void CreateCert() { using (var sshNewServer = new Majorsilence.Vpn.Logic.Ssh.FakeSsh()) using (var sshRevokeServer = new Majorsilence.Vpn.Logic.Ssh.FakeSsh()) using (var sftp = new Majorsilence.Vpn.Logic.Ssh.FakeSftp()) { var certs = new Majorsilence.Vpn.Logic.OpenVpn.CertsOpenVpnGenerateCommand(2, 1, sshNewServer, sshRevokeServer, sftp); certs.Execute(); } }
public void InactiveAccount() { using (var sshClient = new Majorsilence.Vpn.Logic.Ssh.FakeSsh(Majorsilence.Vpn.Logic.Ssh.FakeSsh.TestingScenerios.OpenVpnHappyPath)) using (var sshRevokeClient = new Majorsilence.Vpn.Logic.Ssh.FakeSsh(Majorsilence.Vpn.Logic.Ssh.FakeSsh.TestingScenerios.OpenVpnHappyPath)) using (var sftpClient = new Majorsilence.Vpn.Logic.Ssh.FakeSftp()) { var vpn = new Majorsilence.Vpn.Logic.OpenVpn.CertsOpenVpnGenerateCommand(this.userid, this.vpnseverid, sshClient, sshRevokeClient, sftpClient); Assert.Throws <Majorsilence.Vpn.Logic.Exceptions.AccountNotActiveException>(() => vpn.Execute()); } }
public void GenerateCertHappyPath() { var pay = new Majorsilence.Vpn.Logic.Payments.Payment(this.userid); pay.SaveUserPayment(5, DateTime.UtcNow, Majorsilence.Vpn.Logic.Helpers.SiteInfo.MonthlyPaymentId); using (var sshClient = new Majorsilence.Vpn.Logic.Ssh.FakeSsh(Majorsilence.Vpn.Logic.Ssh.FakeSsh.TestingScenerios.OpenVpnHappyPath)) using (var sshRevokeClient = new Majorsilence.Vpn.Logic.Ssh.FakeSsh(Majorsilence.Vpn.Logic.Ssh.FakeSsh.TestingScenerios.OpenVpnHappyPath)) using (var sftpClient = new Majorsilence.Vpn.Logic.Ssh.FakeSftp()) { var vpn = new Majorsilence.Vpn.Logic.OpenVpn.CertsOpenVpnGenerateCommand(this.userid, this.vpnseverid, sshClient, sshRevokeClient, sftpClient); vpn.Execute(); } }