public async Task SendConfirmationEmail_WhenValidUserIdRecieved() { var config = new Mock <IConfiguration>(); var email = new Mock <IEmailSender>(); var usrmgr = MockUserManager(); var am = new UserEmailManager(config.Object, new NullLogger <UserEmailManager>(), email.Object, usrmgr.Object); var avatar = await am.GenerateEmailConfirmation(_testUser.Id); Assert.True(avatar.Succeeded); }
public async Task ReportError_WhenNotExistsUserIdRecieved() { var config = new Mock <IConfiguration>(); var email = new Mock <IEmailSender>(); var usrmgr = MockUserManager(); var am = new UserEmailManager(config.Object, new NullLogger <UserEmailManager>(), email.Object, usrmgr.Object); var avatar = await am.GenerateEmailConfirmation(Guid.NewGuid().ToString()); Assert.False(avatar.Succeeded); Assert.Equal("Specified user does not exist!", avatar.Error.Description); }
public async Task ReportError_WhenNullUserIdRecieved() { var config = new Mock <IConfiguration>(); var email = new Mock <IEmailSender>(); var usrmgr = MockUserManager(); var am = new UserEmailManager(config.Object, new NullLogger <UserEmailManager>(), email.Object, usrmgr.Object); var avatar = await am.GenerateEmailConfirmation(null); Assert.False(avatar.Succeeded); Assert.Equal("You must provide a user id to generate confirm email!", avatar.Error.Description); }