public void ShouldWalkThePathToDeleteACookie()
{
string basePath = EnvironmentManager.Instance.UrlBuilder.Path;
driver.Url = simpleTestPage;
driver.Manage().DeleteAllCookies();
Cookie cookie1 = new Cookie("fish", "cod");
driver.Manage().AddCookie(cookie1);
int count = driver.Manage().GetCookies().Count;
driver.Url = childPage;
Cookie cookie2 = new Cookie("rodent", "hamster", "/" + basePath + "/child");
driver.Manage().AddCookie(cookie2);
count = driver.Manage().GetCookies().Count;
driver.Url = grandchildPage;
Cookie cookie3 = new Cookie("dog", "dalmation", "/" + basePath + "/child/grandchild/");
driver.Manage().AddCookie(cookie3);
count = driver.Manage().GetCookies().Count;
driver.Url = (EnvironmentManager.Instance.UrlBuilder.WhereIs("child/grandchild"));
driver.Manage().DeleteCookieNamed("rodent");
count = driver.Manage().GetCookies().Count;
Assert.IsNull(driver.Manage().GetCookieNamed("rodent"));
ReadOnlyCollection<Cookie> cookies = driver.Manage().GetCookies();
Assert.AreEqual(2, cookies.Count);
Assert.IsTrue(cookies.Contains(cookie1));
Assert.IsTrue(cookies.Contains(cookie3));
driver.Manage().DeleteAllCookies();
driver.Url = grandchildPage;
cookies = driver.Manage().GetCookies();
Assert.AreEqual(0, cookies.Count);
}