Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CookieStartup
- {
- public override void Configuration
- {
- app.UseCookieAuthentication(options)
- }
- }
- [SetUp]
- public void SetUp()
- {
- _mockAuthListManager = new Mock<IAuthenticationListManager>();
- ApplicationUrl = ApplicationFactory.Create<CookieStartup>();
- Client = new HttpClient(HttpClientHandler)
- {
- BaseAddress = new Uri(ApplicationUrl),
- };
- }
- [Test]
- public void RequestWithCookie_Succeeds()
- {
- FetchCookie();
- var response = Client.GetAsync(ApplicationUrl).Result;
- response.EnsureSuccessStatusCode();
- }
- internal string Create<T>()
- {
- string thisUrl = "http://localhost:" + FreeTCPPort();
- _app = WebApp.Start<T>(thisUrl);
- return thisUrl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement