public async Task Should_Find_Email_By_Type() { var command = EmailFaker.GenerateEmailViewModel().Generate(); await _emailAppService.SaveEmail(command); var email = await _emailAppService.FindByType(command.Type); _database.Emails.FirstOrDefault(f => f.Type == command.Type).Should().NotBeNull(); email.Should().NotBeNull(); email.Sender.Should().NotBeNull(); email.Sender.Name.Should().NotBeNull(); email.Sender.Address.Should().NotBeNull(); }
public async Task <ActionResult <EmailViewModel> > GetEmail(EmailType type) { var email = await _emailAppService.FindByType(type) ?? new EmailViewModel(); return(ResponseGet(email)); }