Exemple #1
0
        public void Should_return_true_if_email_account_id_is_unique()
        {
            var id = Guid.NewGuid();

            var repositoryMock = new Mock <IEmailAccountRepository>();

            repositoryMock.Setup(x => x.GetById(id)).Returns((EmailAccount)null);

            var sut = new EmailAccountRules(repositoryMock.Object);

            var actual = sut.IsEmailAccountIdUnique(id);

            Assert.AreEqual(true, actual);
        }
Exemple #2
0
        public void Should_return_true_if_email_account_name_is_unique()
        {
            var siteId  = Guid.NewGuid();
            var address = "*****@*****.**";

            var repositoryMock = new Mock <IEmailAccountRepository>();

            repositoryMock.Setup(x => x.GetByAddress(siteId, address)).Returns((EmailAccount)null);

            var sut = new EmailAccountRules(repositoryMock.Object);

            var actual = sut.IsEmailAccountAddressUnique(siteId, address);

            Assert.AreEqual(true, actual);
        }