예제 #1
1
        protected MailboxModel(int id, int tenant, IMailAddress address, IMailAccount account,
                            ICollection<IMailAddress> aliases, MailServerBase server)
            : base(new MailAccountBase(account), new MailAddressBase(address), (aliases.Select(a => new MailAddressBase(a)).ToList()))
        {
            if (id < 0)
                throw new ArgumentException("Invalid domain id", "id");

            if (tenant < 0)
                throw new ArgumentException("Invalid tenant id", "tenant");

            if (account == null)
                throw new ArgumentException("Invalid account", "account");

            if (address == null)
                throw new ArgumentException("Invalid address", "address");

            if (aliases == null)
                throw new ArgumentException("Invalid aliases", "aliases");

            if (server == null)
                throw new ArgumentException("Invalid server", "server");

            Id = id;
            Tenant = tenant;
            Account = account;
            Address = address;
            Aliases = aliases;
            Server = server;
        }
예제 #2
0
 public void SetUp()
 {
     server = TestContext.CreateServer();
     peter_domain = server.CreateWebDomain(_peterDomainName, IS_VERIFIED, TestContext.ServerFactory);
     peter_address = TestContext.CreateRandomMailAddress(peter_domain);
     peter_account = TestContext.GetMailAccount(peter_address.LocalPart, _peterDomainName);
 }
예제 #3
0
        protected WebDomainModel(int id, int tenant, string name, bool isVerified, MailServerBase server)
            : base(name)
        {
            if (id < 0)
                throw new ArgumentException("Negative domain teamlab id", "id");

            Id = id;
            Tenant = tenant;
            Server = server;
            IsVerified = isVerified;
        }
예제 #4
0
 public void Init()
 {
     server = TestContext.CreateServer();
     peter_domain = server.CreateWebDomain(_peterDomainName, IS_VERIFIED, TestContext.ServerFactory);
     peter_mail_group_address = TestContext.CreateRandomMailAddress(peter_domain);
     var peterMailboxAddress = TestContext.CreateRandomMailAddress(peter_domain);
     var peterAccount = TestContext.GetMailAccount(peterMailboxAddress.LocalPart, _peterDomainName);
     peter_mailbox = server.CreateMailbox(peterMailboxAddress.LocalPart, PETER_PASSWORD, peterMailboxAddress.Domain, peterAccount,
                                          TestContext.ServerFactory);
     peter_mail_group = server.CreateMailGroup(peter_mail_group_address.LocalPart, peter_mail_group_address.Domain, new List<int> { peter_mailbox.Address.Id }, TestContext.ServerFactory);
 }
 public void Init()
 {
     server = TestContext.CreateServer();
     peter_domain = server.CreateWebDomain(_peterDomainName, IS_VERIFIED, TestContext.ServerFactory);
     peter_address = TestContext.CreateRandomMailAddress(peter_domain);
     peter_second_address = TestContext.CreateRandomMailAddress(peter_domain);
     peter_alias = TestContext.CreateRandomMailAddress(peter_domain);
     peter_account = TestContext.GetMailAccount(peter_address.LocalPart, _peterDomainName);
     peter_second_account = TestContext.GetMailAccount(peter_second_address.LocalPart, _peterDomainName);
     peter_mailbox = server.CreateMailbox(peter_address.LocalPart, PETER_PASSWORD, peter_domain, peter_account, TestContext.ServerFactory);
     peter_second_mailbox = server.CreateMailbox(peter_second_address.LocalPart, PETER_PASSWORD, peter_domain, peter_second_account, TestContext.ServerFactory);
 }
예제 #6
0
        protected MailGroupModel(int id, int tenant, IMailAddress address, List<IMailAddress> inAddresses, MailServerBase server)
            : base(new MailAddressBase(address), (inAddresses.Select(a => new MailAddressBase(a)).ToList()))
        {
            if (id < 0)
                throw new ArgumentException("Invalid domain id", "id");

            if (tenant < 0)
                throw new ArgumentException("Invalid tenant id", "tenant");

            if (address == null)
                throw new ArgumentException("Invalid address", "address");

            if (inAddresses == null)
                throw new ArgumentException("Invalid aliases", "inAddresses");

            if (server == null)
                throw new ArgumentException("Invalid server", "server");

            Id = id;
            Tenant = tenant;
            Address = address;
            InAddresses = inAddresses;
            Server = server;
        }
예제 #7
0
 public MockMailGroup(int id, int tenant, IMailAddress address, List<IMailAddress> inAddresses, MailServerBase server) 
     : base(id, tenant, address, inAddresses, server)
 {
     _serverData = MockServerData.GetInstance();
 }
예제 #8
0
 public MockMailbox(int id, int tenant, IMailAddress address, IMailAccount account, 
     List<IMailAddress> aliases, MailServerBase server) 
     : base(id, tenant, address, account, aliases, server)
 {
     _serverData = MockServerData.GetInstance();
 }
 public abstract IWebDomain CreateWebDomain(int id, int tenant, string name, bool isVerified, MailServerBase server);
 public abstract IMailGroup CreateMailGroup(int id, int tenant, IMailAddress address, List<IMailAddress> inAddresses, MailServerBase server);
 public abstract IMailbox CreateMailbox(int id, int tenant, IMailAddress address, IMailAccount account,
                     List<IMailAddress> aliases, MailServerBase server);
예제 #12
0
 public override IMailbox CreateMailbox(int id, int tenant, IMailAddress address, IMailAccount account, List<IMailAddress> aliases,
                                            MailServerBase server)
 {
     return new PostfixMailbox(id, tenant, address, account, aliases, server);
 }
예제 #13
0
 public void Init()
 {
     _server = TestContext.CreateServer();
     _petersDomain = _server.CreateWebDomain(_peterDomainName, IS_VERIFIED, TestContext.ServerFactory);
     _peterAddress = TestContext.CreateRandomMailAddress(_petersDomain);
 }
예제 #14
0
 public PostfixMailbox(int id, int tenant, IMailAddress address, IMailAccount account, List<IMailAddress> aliases, MailServerBase server) 
     : base(id, tenant, address, account, aliases, server)
 {
 }
예제 #15
0
 public void Dispose()
 {
     server.DeleteWebDomain(peter_domain, TestContext.ServerFactory);
     server = null;
 }
예제 #16
0
 public void Init()
 {
     server = TestContext.CreateServer();
     peter_domain = server.CreateWebDomain(_peterDomainName, IS_VERIFIED, TestContext.ServerFactory);
 }
예제 #17
0
 public override IWebDomain CreateWebDomain(int id, int tenant, string name, bool isVerified, MailServerBase server)
 {
     return new PostfixDomain(id, tenant, name, isVerified, server);
 }
예제 #18
0
 public override IMailGroup CreateMailGroup(int id, int tenant, IMailAddress address, List<IMailAddress> inAddresses, MailServerBase server)
 {
     return new PostfixMailGroup(id, tenant, address, inAddresses, server);
 }
예제 #19
0
 public PostfixDomain(int id, int tenant, string name, bool isVerified, MailServerBase server)
     : base(id, tenant, name, isVerified, server)
 {
 }
예제 #20
0
 public void SetUp()
 {
     factory = TestContext.ServerFactory;
     server = TestContext.CreateServer();
 }
예제 #21
0
 public PostfixMailGroup(int id, int tenant, IMailAddress address, List<IMailAddress> inAddresses, MailServerBase server) 
     : base(id, tenant, address, inAddresses, server)
 {
 }