Advertisement
Guest User

12345

a guest
Oct 14th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1.  
  2. public class TestContextComponent
  3. {
  4. protected BricksClientHost<ClientApplication> Host { get; set; }
  5. public BricksRequestContext context { get; set; }
  6.  
  7. public TestContextComponent()
  8. {
  9. CreateHostEnv();
  10. context = Host.App.CreateRequestContext();
  11. }
  12.  
  13. public void CreateHostEnv()
  14. {
  15. Host = new BricksClientHost<ClientApplication>();
  16. Host.InitializeApplication();
  17. Host.InitializeHost();
  18. Host.InitializeSecondaryAdapters();
  19. }
  20.  
  21. public void SignIn()
  22. {
  23. getBricksAuthenticationService().SignIn(context, 1, "admin");
  24. }
  25.  
  26. public BricksRequestContext getContext()
  27. {
  28. return context; ;
  29. }
  30.  
  31. public BricksCommonService getBricksCommonService()
  32. {
  33. return context.GetService<BricksCommonService>();
  34. }
  35.  
  36. public BricksAuthenticationService getBricksAuthenticationService()
  37. {
  38. return context.GetService<BricksAuthenticationService>();
  39. }
  40.  
  41. public BricksLogisticStrategyService getBricksLogisticStrategyService()
  42. {
  43. return context.GetService<BricksLogisticStrategyService>();
  44. }
  45.  
  46. public BricksLogisticStructureService getBricksLogisticStructureService()
  47. {
  48. return context.GetService<BricksLogisticStructureService>();
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement