本文整理汇总了C#中TestState.VerifyRequestCookie方法的典型用法代码示例。如果您正苦于以下问题:C# TestState.VerifyRequestCookie方法的具体用法?C# TestState.VerifyRequestCookie怎么用?C# TestState.VerifyRequestCookie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestState
的用法示例。
在下文中一共展示了TestState.VerifyRequestCookie方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CookiesOnTheRequestAndInTheContainer
public async Task CookiesOnTheRequestAndInTheContainer()
{
// ARRANGE
var ts = new TestState
{
Request =
{
Headers =
{
{"Cookie", "a=1; b=2"},
{"cookie", "c=3; "},
{"COOKIE", "d=4;"},
{"cOOKIE", "e=5"}
}
}
};
ts.CookieContainer.Add(ts.Uri, new Cookie("f", "6"));
ts.CookieContainer.Add(ts.Uri, new Cookie("g", "7"));
// ACT
await ts.HttpClient.SendAsync(ts.Request);
// ASSERT
ts.VerifyRequestCookie("a=1; b=2; c=3; d=4; e=5; f=6; g=7");
}
示例2: CookiesOnTheRequestButNotInTheContainer
public async Task CookiesOnTheRequestButNotInTheContainer()
{
// ARRANGE
var ts = new TestState
{
Request =
{
Headers =
{
{"Cookie", "a=1; b=2"},
{"cookie", "c=3; "},
{"COOKIE", "d=4;"},
{"cOOKIE", "e=5"}
}
}
};
// ACT
await ts.HttpClient.SendAsync(ts.Request);
// ASSERT
ts.VerifyRequestCookie("a=1; b=2; c=3; d=4; e=5");
ts.VerifyEmptyCookieContainer();
}
示例3: CookiesInTheContainerButNotOnTheRequest
public async Task CookiesInTheContainerButNotOnTheRequest()
{
// ARRANGE
var ts = new TestState();
ts.CookieContainer.Add(ts.Uri, new Cookie("a", "1"));
ts.CookieContainer.Add(ts.Uri, new Cookie("b", "2"));
// ACT
await ts.HttpClient.SendAsync(ts.Request);
// ASSERT
ts.VerifyRequestCookie("a=1; b=2");
}