예제 #1
0
        public void EMailExists_NotExistingEmail_ReturnsFalse()
        {
            var testDatabaseContext = DbContextFactory.Create();

            var timeProviderMock = new Mock <ITimeProvider>();

            timeProviderMock.Setup(p => p.Now()).Returns(new DateTime(2016, 1, 1));

            var profileService = new ProfileService(testDatabaseContext, timeProviderMock.Object);
            var result         = profileService.EMailExists("*****@*****.**");

            Assert.False(result);
        }
예제 #2
0
        public void EMailExists_ExistingEMail_ReturnsTrue(string email)
        {
            var testDatabaseContext = DbContextFactory.Create();

            var timeProviderMock = new Mock <ITimeProvider>();

            timeProviderMock.Setup(p => p.Now()).Returns(new DateTime(2016, 1, 1));

            var profileService = new ProfileService(testDatabaseContext, timeProviderMock.Object);
            var result         = profileService.EMailExists(email);

            Assert.True(result);
        }