public void Clone_EmptyCookieContainer_ReturnsEmptyCookieContainer() { var cookieContainer = new CookieContainer(); var clonedCookieContainer = cookieContainer.Clone(new Uri("http://localhost")); Assert.That(clonedCookieContainer, Has.Count.EqualTo(0)); }
public void Clone_SingleCookieForLocalHost_ReturnsCookieContainerWithSingleCookieForLocalHost() { var localhostUri = new Uri("http://localhost"); var cookieContainer = new CookieContainer(); cookieContainer.Add(localhostUri, new Cookie("value", "123")); var clonedCookieContainer = cookieContainer.Clone(localhostUri); Assert.That(clonedCookieContainer, Has.Count.EqualTo(1)); Assert.That(clonedCookieContainer.GetCookies(localhostUri)["value"]?.Value, Is.EqualTo("123")); }