public async Task NotDeleteOrganizationsThatDoNotMatchOrganizationIdOnCommand() { var command = new DeleteOrganization { Id = 999 }; var handler = new DeleteOrganizationHandler(Context); await handler.Handle(command); Assert.Equal(2, Context.Organizations.Count()); }
public async Task DeleteOrganizationThatMatchesOrganizationIdOnCommand() { var command = new DeleteOrganization { Id = 1 }; var handler = new DeleteOrganizationHandler(Context); await handler.Handle(command); var data = Context.Organizations.Count(_ => _.Id == 1); Assert.Equal(0, data); }
public async Task DeleteTheOrganization() { var command = new DeleteOrganization { Id = 1 }; var handler = new DeleteOrganizationHandler(Context); await handler.Handle(command); Assert.False(Context.Organizations.Any(x => x.Id == command.Id)); }