예제 #1
0
 private static ExpensesController CreateExpensesControllerWithoutNameIdentifierClaim(
     IExpensesRepository expensesRepository,
     IExpensesMapper expensesMapper)
 {
     return(new ExpensesController(expensesRepository, expensesMapper)
     {
         ControllerContext = new ControllerContext
         {
             HttpContext = new DefaultHttpContext {
                 User = new ClaimsPrincipal()
             }
         }
     });
 }
예제 #2
0
 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;
 }