Beispiel #1
0
        public async Task DeleteUser_ValidInput_Failed()
        {
            var functionsController = new FunctionsController(_context);
            var result = await functionsController.DeleteFunction("DeleteUser_ValidInput_Failed");

            Assert.IsType <NotFoundObjectResult>(result);
        }
        public async Task DeleteUser_ValidInput_Failed()
        {
            _localizer    = MockLocalizer();
            _returnString = MockString();
            var controller = new FunctionsController(_context, _mockLogger.Object, _mapper, _localizer, _returnString);
            var result     = await controller.DeleteFunction("DeleteUser_ValidInput_Failed");

            Assert.IsType <NotFoundObjectResult>(result);
        }
Beispiel #3
0
        public async Task DeleteUser_ValidInput_Success()
        {
            _context.Functions.AddRange(new List <Function>()
            {
                new Function()
                {
                    Id        = "DeleteUser_ValidInput_Success",
                    ParentId  = null,
                    Name      = "DeleteUser_ValidInput_Success",
                    SortOrder = 1,
                    Url       = "/DeleteUser_ValidInput_Success"
                }
            });
            await _context.SaveChangesAsync();

            var functionsController = new FunctionsController(_context);
            var result = await functionsController.DeleteFunction("DeleteUser_ValidInput_Success");

            Assert.IsType <OkObjectResult>(result);
        }
        public async Task DeleteUser_ValidInput_Success()
        {
            _localizer    = MockLocalizer();
            _returnString = MockString();
            _context.Functions.AddRange(new List <Function>()
            {
                new Function()
                {
                    Id        = "DeleteUser_ValidInput_Success",
                    ParentId  = null,
                    NameTemp  = "DeleteUser_ValidInput_Success",
                    SortOrder = 1,
                    Url       = "/DeleteUser_ValidInput_Success"
                }
            });
            await _context.SaveChangesAsync();

            var controller = new FunctionsController(_context, _mockLogger.Object, _mapper, _localizer, _returnString);
            var result     = await controller.DeleteFunction("DeleteUser_ValidInput_Success");

            Assert.IsType <OkObjectResult>(result);
        }