public async Task CountAsyncShoulReturnCorrectCount() { var db = DbInfrastructure.GetDatabase(); await this.Add100AnsweredContacts(db); await this.Add100UnansweredContacts(db); await this.Add100RandomAnsweredContacts(db); var contactAdminService = new ContactAdminService(db); var count = await contactAdminService.CountAsync(); count.Should().Be(300); }
public async Task DeleteAsyncShouldDeleteContact() { var db = DbInfrastructure.GetDatabase(); var contact = new Contact { Title = "Title", Message = "Message" }; await db.AddAsync(contact); await db.SaveChangesAsync(); var contactAdminService = new ContactAdminService(db); await contactAdminService.DeleteAsync(contact.Id); var count = await contactAdminService.CountAsync(); count.Should().Be(0); }