public async Task GetAccessCardsShouldReturnCards() { if ("Test" == ConfigurationManager.AppSettings["Environment"]) { // Ignore integration tests on appharbour return; } // Arrange var proxy = new SlScreenScraper(IntegrationTestsCredentials.Username, IntegrationTestsCredentials.Password); // Act var authenticationResult = await proxy.Authenticate(); List<AccessCard> cards = null; if (authenticationResult.Authenticated) { cards = await proxy.GetAccessCards(authenticationResult.PartyRef); } // Assert cards.Should().NotBeNull(); if (cards != null) { cards.Count.Should().BeGreaterThan(0); } }
public async Task AuthenticationUsingCookiesShouldWork() { if ("Test" == ConfigurationManager.AppSettings["Environment"]) { // Ignore integration tests on appharbour return; } // Arrange var authScraper = new SlScreenScraper(IntegrationTestsCredentials.Username, IntegrationTestsCredentials.Password); SlScreenScraper cookieAuthScraper; // Act var authResult = await authScraper.Authenticate(); cookieAuthScraper = new SlScreenScraper(authScraper.GetCookieHeader()); var cards = await cookieAuthScraper.GetAccessCards(authResult.PartyRef); // Assert cards.Should().NotBeNull(); if (cards != null) { cards.Count.Should().BeGreaterThan(0); } }