private static ExpensesController CreateExpensesControllerWithoutNameIdentifierClaim( IExpensesRepository expensesRepository, IExpensesMapper expensesMapper) { return(new ExpensesController(expensesRepository, expensesMapper) { ControllerContext = new ControllerContext { HttpContext = new DefaultHttpContext { User = new ClaimsPrincipal() } } }); }
private static ExpensesController CreateExpensesControllerWithNameIdentifierClaim( IExpensesRepository expensesRepository, IExpensesMapper expensesMapper) { return(new ExpensesController(expensesRepository, expensesMapper) { ControllerContext = new ControllerContext { HttpContext = new DefaultHttpContext { User = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(ClaimTypes.NameIdentifier, SampleNameIdentifier), })) } } }); }
public ExpensesController(IExpensesRepository expensesRepository, IExpensesMapper expensesMapper) { _expensesRepository = expensesRepository; _expensesMapper = expensesMapper; }