OpenQA.Selenium.CookieImplementationTest.ShouldNotBeAbleToSetDomainToSomethingThatIsUnrelatedToTheCurrentDomain C# (CSharp) Méthode

ShouldNotBeAbleToSetDomainToSomethingThatIsUnrelatedToTheCurrentDomain() private méthode

        public void ShouldNotBeAbleToSetDomainToSomethingThatIsUnrelatedToTheCurrentDomain()
        {
            driver.Url = simpleTestPage;
            driver.Manage().DeleteAllCookies();

            Cookie cookie1 = new Cookie("fish", "cod");
            IOptions options = driver.Manage();
            options.AddCookie(cookie1);

            string url = EnvironmentManager.Instance.UrlBuilder.WhereElseIs("simpleTest.html");
            driver.Url = url;

            Assert.IsNull(options.GetCookieNamed("fish"));
        }