public void TestInitializers() { _mapper = Substitute.For <IMapper>(); _lotteryService = Substitute.For <ILotteryService>(); _lotteryExportService = Substitute.For <ILotteryExportService>(); _lotteryController = new LotteryController(_mapper, _lotteryService, _lotteryExportService); _lotteryController.ControllerContext = Substitute.For <HttpControllerContext>(); _lotteryController.Request = new HttpRequestMessage(); _lotteryController.Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration()); _lotteryController.Request.SetConfiguration(new HttpConfiguration()); _lotteryController.RequestContext.Principal = new ClaimsPrincipal(new ClaimsIdentity(new[] { new Claim(ClaimTypes.NameIdentifier, "1"), new Claim("OrganizationId", "1") })); }
public LotteryController(IMapper mapper, ILotteryService lotteryService, ILotteryExportService lotteryExportService) { _mapper = mapper; _lotteryService = lotteryService; _lotteryExportService = lotteryExportService; }