public string GetPuzzleInput(string url) { using var client = new WebClient(); client.Headers.Add("cookie", _cookieRequestor.GetCookie()); try { var webpage = client.DownloadString(url); return(webpage); } catch (WebException e) when(e.Message.Equals("The remote server returned an error: (400) Bad Request.", StringComparison.InvariantCultureIgnoreCase)) { Console.WriteLine("The Cookie is likely to be incorrect, please read the readme on how to get the correct cookie."); throw; } }
public void Then_the_cookie_value_is_returned() { Assert.That(_sut.GetCookie(), Is.EqualTo(Cookie)); }