public async Task <HttpResponseMessage> UpdateOperativeSystem(UpdateOperativeSystemRequest updateOperativeSystemRequest)
        {
            var content = IntegrationHttpRequest.CreateContentRequest(updateOperativeSystemRequest);
            HttpResponseMessage response = await client.PutAsync(UrlBase + "api/v1/update-operative-system", content);

            return(response);
        }
        public async Task <bool> UpdateOperativeSystemAsync(UpdateOperativeSystemRequest request)
        {
            var result = await UpdateAsync(_mapper.Map <DomainModel.OperativeSystem>(request));

            await SaveAsync();

            return(result);
        }
        public async Task TestUpdateOperativeSystem(UpdateOperativeSystemRequest obj, ObjectResult resultAction, bool elementCreated = false)
        {
            OperativeSystemResponse defaultCompany = await this.CreatedDefaultOperativeSystem();

            obj.Id = elementCreated == true ? defaultCompany.Id : obj.Id;

            IActionResult actionResult = await this.UpdateOperativeSystem(obj);

            base.CheckAssert(actionResult, resultAction);
        }
예제 #4
0
        public async Task TestUpdateOperativeSystem(UpdateOperativeSystemRequest obj, ObjectResult resultAction, bool elementCreated = false)
        {
            var createdcompanyId = OperativeSystemComponentsValues.GetOperativeSystemAviability();

            obj.Id = elementCreated == true ? createdcompanyId : obj.Id;

            HttpResponseMessage actionResult = await _operativeSystemAPI.UpdateOperativeSystem(obj);

            base.CheckAssert(actionResult, resultAction);
        }
        private async Task <IActionResult> UpdateOperativeSystem(UpdateOperativeSystemRequest updateOperativeSystemRequest)
        {
            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> mockCreateRequest = MockHttpRequest.CreateMockRequest(updateOperativeSystemRequest);
                return(await controller.UpdateOperativeSystemAsync(mockCreateRequest.Object, _logger)); //as GridController;
            }
        }
예제 #6
0
        public async Task <bool> UpdateOperativeSystemAsync(UpdateOperativeSystemRequest request)
        {
            var result = await _operativeSystemRepository.UpdateOperativeSystemAsync(request);

            return(result);
        }