public async Task <HttpResponseMessage> DeleteOperativeSystem(DeleteOperativeSystemByIdRequest deleteOperativeSystemRequest)
        {
            var content = IntegrationHttpRequest.CreateQuery(deleteOperativeSystemRequest);
            HttpResponseMessage response = await client.DeleteAsync(UrlBase + String.Format("api/v1/delete-operative-system?{0}", content));

            return(response);
        }
        public async Task <bool> DeleteOperativeSystemByIdAsync(DeleteOperativeSystemByIdRequest request)
        {
            var result = await DeleteAsync <DomainModel.OperativeSystem>(request.Id);

            await SaveAsync();

            return(result);
        }
示例#3
0
        public async Task TestDeleteOperativeSystem(DeleteOperativeSystemByIdRequest delcom, ObjectResult resultAction, bool elementCreated = false)
        {
            Guid createdtransactionId = OperativeSystemComponentsValues.GetOperativeSystemAviability();

            delcom.Id = elementCreated == true ? createdtransactionId : delcom.Id;

            HttpResponseMessage actionResult = await _operativeSystemAPI.DeleteOperativeSystem(delcom);

            base.CheckAssert(actionResult, resultAction);
        }
        public async Task TestDeleteOperativeSystem(DeleteOperativeSystemByIdRequest delnot, ObjectResult resultAction, bool elementCreated = false)
        {
            OperativeSystemResponse defaultHardware = await this.CreatedDefaultOperativeSystem();

            //Guid createdtransactionId = CompanyComponentsValues.GetCompanyAviability();

            delnot.Id = elementCreated == true ? defaultHardware.Id : delnot.Id;

            IActionResult actionResult = await this.DeleteOperativeSystem(delnot);

            base.CheckAssert(actionResult, resultAction);
        }
        private async Task <IActionResult> DeleteOperativeSystem(DeleteOperativeSystemByIdRequest deleteOperativeSystemRequest)
        {
            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.CreateMockQuery(deleteOperativeSystemRequest.Id);
                return(await controller.DeleteOperativeSystemAsync(mockCreateRequest.Object, _logger)); //as GridController;
            }
        }
示例#6
0
        public async Task <bool> DeleteOperativeSystemByIdAsync(DeleteOperativeSystemByIdRequest request)
        {
            var result = await _operativeSystemRepository.DeleteOperativeSystemByIdAsync(request);

            return(result);
        }