public async Task PutUser_ValidInput_Success() { _context.Functions.AddRange(new List <Function>() { new Function() { Id = "PutUser_ValidInput_Success", ParentId = null, Name = "PutUser_ValidInput_Success", SortOrder = 1, Url = "/PutUser_ValidInput_Success" } }); await _context.SaveChangesAsync(); var functionsController = new FunctionsController(_context); var result = await functionsController.PutFunction("PutUser_ValidInput_Success", new FunctionCreateRequest() { ParentId = null, Name = "PutUser_ValidInput_Success updated", SortOrder = 6, Url = "/PutUser_ValidInput_Success" }); Assert.IsType <NoContentResult>(result); }
public async Task PutFunction_ValidInput_Success() { _localizer = MockLocalizer(); _returnString = MockString(); _context.Functions.AddRange(new List <Function>() { new Function() { Id = "PutUser_ValidInput_Success", ParentId = null, NameTemp = "PutUser_ValidInput_Success", SortOrder = 1, Url = "/PutUser_ValidInput_Success" } }); await _context.SaveChangesAsync(); var controller = new FunctionsController(_context, _mockLogger.Object, _mapper, _localizer, _returnString); var result = await controller.PutFunction("PutUser_ValidInput_Success", new FunctionCreateRequest() { ParentId = null, NameTemp = "PutUser_ValidInput_Success updated", SortOrder = 6, Url = "/PutUser_ValidInput_Success" }); Assert.IsType <NoContentResult>(result); }
public async Task PutUser_ValidInput_Failed() { var functionsController = new FunctionsController(_context); var result = await functionsController.PutFunction("PutUser_ValidInput_Failed", new FunctionCreateRequest() { ParentId = null, Name = "PutUser_ValidInput_Failed update", SortOrder = 6, Url = "/PutUser_ValidInput_Failed" }); Assert.IsType <NotFoundObjectResult>(result); }
public async Task PutFunction_ValidInput_Failed() { _localizer = MockLocalizer(); _returnString = MockString(); var controller = new FunctionsController(_context, _mockLogger.Object, _mapper, _localizer, _returnString); var result = await controller.PutFunction("PutUser_ValidInput_Failed", new FunctionCreateRequest() { ParentId = null, NameTemp = "PutUser_ValidInput_Failed update", SortOrder = 6, Url = "/PutUser_ValidInput_Failed" }); Assert.IsType <NotFoundObjectResult>(result); }