本文整理汇总了C#中System.Net.Cookie.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Cookie.Equals方法的具体用法?C# Cookie.Equals怎么用?C# Cookie.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Net.Cookie
的用法示例。
在下文中一共展示了Cookie.Equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetCookieCollectionFilledWithCookiesOnDispose
public void SetCookieCollectionFilledWithCookiesOnDispose() {
var cookie = new Cookie("name", "value", this.url.AbsolutePath, this.url.Host);
using (var auth = new PersistentStandardAuthenticationProvider(this.storage.Object, this.url)) {
auth.Cookies.Add(cookie);
}
this.storage.VerifySet(s => s.Cookies = It.Is<CookieCollection>(cc => cc.Count == 1 && cookie.Equals(cc[0])));
}
示例2: Equals
public void Equals ()
{
Cookie c1 = new Cookie ("NAME", "VALUE", "PATH", "DOMAIN");
Cookie c2 = new Cookie ("name", "value", "path", "domain");
Assertion.Assert("#1", !c1.Equals (c2));
c2.Value = "VALUE";
c2.Path = "PATH";
Assertion.Assert("#2", c1.Equals (c2));
c2.Version = 1;
Assertion.Assert("#3", !c1.Equals (c2));
}