public async Task ReturnAllOrganizationsAsListOfSelectListItems() { var organizations = new List<Organization> { new Organization { Id = 1, Name = "org1" }, new Organization { Id = 2, Name = "org2" }, }; var context = Context; context.Organizations.AddRange(organizations); context.SaveChanges(); var sut = new OrganizationSelectListQueryHandlerAsync(context); var result = await sut.Handle(new OrganizationSelectListQueryAsync()); Assert.IsType<List<SelectListItem>>(result); }
public async Task ReturnAllOrganizationsAsListOfSelectListItems() { var organizations = new List <Organization> { new Organization { Id = 1, Name = "org1" }, new Organization { Id = 2, Name = "org2" }, }; var context = Context; context.Organizations.AddRange(organizations); context.SaveChanges(); var sut = new OrganizationSelectListQueryHandlerAsync(context); var result = await sut.Handle(new OrganizationSelectListQueryAsync()); Assert.IsType <List <SelectListItem> >(result); }