public async Task <OperativeSystemResponse> GetOperativeSystemByIdAsync(GetOperativeSystemByIdRequest request) { return(await GetAsync <DomainModel.OperativeSystem>() .Where(x => x.Id == request.Id) .ProjectTo <OperativeSystemResponse>(_mapper.ConfigurationProvider) .FirstOrDefaultAsync()); }
public async Task TestGetOperativeSystem(GetOperativeSystemByIdRequest getcom, ObjectResult resultAction, bool elementCreated = false) { OperativeSystemResponse defaultHardware = await this.CreatedDefaultOperativeSystem(); getcom.Id = elementCreated == true ? defaultHardware.Id : getcom.Id; IActionResult actionResult = await this.GetOperativeSystemById(getcom); base.CheckAssert(actionResult, resultAction); }
public async Task <HttpResponseMessage> GetOperativeSystemById(GetOperativeSystemByIdRequest getOperativeSystemByIdRequest) { //getCompanyRequest.Id = Guid.Parse("6383ff38-92f9-4bda-e61a-08d783dd9ba7"); var content = IntegrationHttpRequest.CreateQuery(getOperativeSystemByIdRequest); HttpResponseMessage response = await client.GetAsync(UrlBase + String.Format("api/v1/get-operative-system-by-id?{0}", content)); return(response); }
public async Task TestGetOperativeSystem(GetOperativeSystemByIdRequest com, ObjectResult resultAction, bool elementCreated = false) { Guid createdcompanyId = OperativeSystemComponentsValues.GetOperativeSystemAviability(); com.Id = elementCreated == true ? createdcompanyId : com.Id; HttpResponseMessage actionResult = await _operativeSystemAPI.GetOperativeSystemById(com); base.CheckAssert(actionResult, resultAction); }
private async Task <IActionResult> GetOperativeSystemById(GetOperativeSystemByIdRequest getOperativeSystemRequest) { var options = new DbContextOptionsBuilder <Context>() .UseInMemoryDatabase(databaseName: "OperativeSystem") .Options; // Run the test against one instance of the context using (var context = new Context(options)) { var repository = new OperativeSystemRepository(context, AutomapperSingleton.Mapper); var service = new OperativeSystemService(repository, AutomapperSingleton.Mapper); var controller = new OperativeSystemController(service); Mock <HttpRequest> mockGetRequest = MockHttpRequest.CreateMockQuery(getOperativeSystemRequest.Id); return(await controller.GetOperativeSystemByIdAsync(mockGetRequest.Object, _logger)); //as GridController; } }
public async Task <OperativeSystemResponse> GetOperativeSystemByIdAsync(GetOperativeSystemByIdRequest request) { var result = await _operativeSystemRepository.GetOperativeSystemByIdAsync(request); return(result); }