Пример #1
0
        public void GetEmailAddress_ShouldReturnEmailAddressFromDb()
        {
            SeedEmailAddresses();
            var repository = new EmailRepository(_context);

            // Test case
            var testEmailAddress = new EmailAddressModel()
            {
                Name  = "Mike C",
                Email = "*****@*****.**"
            };

            var actualEmailAddress = repository.GetEmailAddress(testEmailAddress);

            // Assert
            Assert.True(actualEmailAddress != null);
            Assert.True(testEmailAddress.Name != testEmailAddress.Email);
            Assert.True(actualEmailAddress.Name != actualEmailAddress.Email);
            Assert.Equal(testEmailAddress.Email, actualEmailAddress.Email);
            Assert.Equal(testEmailAddress.Name, actualEmailAddress.Name);
        }