Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. public class CookieStartup
  2. {
  3. public override void Configuration
  4. {
  5. app.UseCookieAuthentication(options)
  6. }
  7. }
  8.  
  9. [SetUp]
  10. public void SetUp()
  11. {
  12. _mockAuthListManager = new Mock<IAuthenticationListManager>();
  13.  
  14. ApplicationUrl = ApplicationFactory.Create<CookieStartup>();
  15. Client = new HttpClient(HttpClientHandler)
  16. {
  17. BaseAddress = new Uri(ApplicationUrl),
  18. };
  19. }
  20.  
  21. [Test]
  22. public void RequestWithCookie_Succeeds()
  23. {
  24. FetchCookie();
  25.  
  26. var response = Client.GetAsync(ApplicationUrl).Result;
  27.  
  28. response.EnsureSuccessStatusCode();
  29. }
  30.  
  31. internal string Create<T>()
  32. {
  33. string thisUrl = "http://localhost:" + FreeTCPPort();
  34. _app = WebApp.Start<T>(thisUrl);
  35.  
  36. return thisUrl;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement