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); }
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); }