Beispiel #1
0
        public void SetUp()
        {
            _command = new EmailAccountDetails
            {
                SiteId             = Guid.NewGuid(),
                Id                 = Guid.NewGuid(),
                Address            = "*****@*****.**",
                DisplayName        = "My Site",
                Host               = "host",
                Port               = 25,
                UserName           = "******",
                Password           = "******",
                DefaultCredentials = true,
                Ssl                = true
            };

            _emailAccountRulesMock = new Mock <IEmailAccountRules>();
            _emailAccountRulesMock.Setup(x => x.IsEmailAccountIdUnique(_command.Id)).Returns(true);

            _siteRulesMock = new Mock <ISiteRules>();
            _siteRulesMock.Setup(x => x.DoesSiteExist(_command.SiteId)).Returns(true);

            _validator = new EmailAccountDetailsValidator <EmailAccountDetails>(_emailAccountRulesMock.Object, _siteRulesMock.Object);
        }
Beispiel #2
0
 private bool HaveUniqueAddress(EmailAccountDetails cmd, string name)
 {
     return(_emailAccountRules.IsEmailAccountAddressUnique(cmd.SiteId, name));
 }