public void TestSaveCookieStore()
        {
            var cookieStore = new CookieStore(database, "cookie_store_unit_test");
            Assert.AreEqual(0, cookieStore.Count);

            var name = "foo";
            var value = "bar";
            var uri = new Uri("http://foo.com/baz");
            var domain = uri.Host;
            var path = uri.PathAndQuery;
            var httpOnly = false;
            var isSecure = false;
            var expires = DateTime.Now.Add(TimeSpan.FromDays(1));

            var cookie = new Cookie(name, value);
            cookie.Path = path;
            cookie.Domain = domain;
            cookie.HttpOnly = httpOnly;
            cookie.Secure = isSecure;
            cookie.Expires = expires;

            cookieStore.Add(cookie);
            cookieStore.Save();

            cookieStore = new CookieStore(database, "cookie_store_unit_test");
            Assert.AreEqual(1, cookieStore.Count);

            var cookies = cookieStore.GetCookies(uri);
            Assert.AreEqual(1, cookies.Count);
            Assert.AreEqual(name, cookies[0].Name);
            Assert.AreEqual(value, cookies[0].Value);
            Assert.AreEqual(path, cookies[0].Path);
            Assert.AreEqual(domain, cookies[0].Domain);
            Assert.AreEqual(expires, cookies[0].Expires);
        }
        public void TestSaveEmptyCookieStore()
        {
            var cookieStore = new CookieStore(database, "cookie_store_unit_test");
            Assert.AreEqual(0, cookieStore.Count);
            cookieStore.Save();

            cookieStore = new CookieStore(database, "cookie_store_unit_test");
            Assert.AreEqual(0, cookieStore.Count);
        }
        public void TestSaveEmptyCookieStore()
        {
            var cookieStore = new CookieStore(GetCookiesDirectory().FullName);
            Assert.AreEqual(0, cookieStore.Count);
            cookieStore.Save();

            cookieStore = new CookieStore(GetCookiesDirectory().FullName);
            Assert.AreEqual(0, cookieStore.Count);
        }