public async Task <ActionResult <IEnumerable <WorkType> > > GetWorkTypes() { var strings = await workTypeRepository.GetAllAsync(); if (strings == null) { return(BadRequest("Strings not found")); } return(Ok(strings)); }
public async Task Work_Type_Repository_Should_Get_All_Async() { // Arrange var context = TestSetUpHelper.CreateDbContext(); var repository = new WorkTypeRepository(context); var expectedEntity = new WorkType() { Id = 40, Name = "TestName", EstimatedTime = 1, EstimatedCost = 100 }; await repository.AddAsync(expectedEntity); await context.SaveChangesAsync(); // Act var entities = await repository.GetAllAsync(); // Assert Assert.Single(entities.ToList()); }