本文整理匯總了C#中Tests.FullInputContext.InitUserFromCookie方法的典型用法代碼示例。如果您正苦於以下問題:C# FullInputContext.InitUserFromCookie方法的具體用法?C# FullInputContext.InitUserFromCookie怎麽用?C# FullInputContext.InitUserFromCookie使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tests.FullInputContext
的用法示例。
在下文中一共展示了FullInputContext.InitUserFromCookie方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: UserTests
/// <summary>
/// Constructor for the User Tests to set up the context for the tests
/// </summary>
public UserTests()
{
using (FullInputContext fullinputcontext = new FullInputContext(TestUserAccounts.GetProfileAPITestUserAccount.UserName))
{
fullinputcontext.SetCurrentSite("h2g2");
fullinputcontext.InitUserFromCookie(TestUserAccounts.GetProfileAPITestUserAccount.Cookie, TestUserAccounts.GetProfileAPITestUserAccount.SecureCookie);
_testUser = (User)fullinputcontext.ViewingUser;
}
}
示例2: Test6CheckUserNameChange
public void Test6CheckUserNameChange()
{
Console.WriteLine("Before Test6CheckUserNameChange");
string originalUserName = _testUser.UserName;
//change to new user name
string newUserName = originalUserName + "new";
_testUser.BeginUpdateDetails();
_testUser.SetUsername(newUserName);
_testUser.UpdateDetails();
using (FullInputContext fullinputcontext = new FullInputContext(TestUserAccounts.GetProfileAPITestUserAccount.UserName))
{
fullinputcontext.SetCurrentSite("h2g2");
fullinputcontext.InitUserFromCookie(TestUserAccounts.GetProfileAPITestUserAccount.Cookie, TestUserAccounts.GetProfileAPITestUserAccount.SecureCookie);
User tempUser = new User(fullinputcontext);
tempUser.CreateUser(_testUser.UserID);
Assert.AreEqual(tempUser.UserName, newUserName);
}
//change back to old user name
_testUser.BeginUpdateDetails();
_testUser.SetUsername(originalUserName);
_testUser.UpdateDetails();
using (FullInputContext fullinputcontext = new FullInputContext(TestUserAccounts.GetProfileAPITestUserAccount.UserName))
{
fullinputcontext.SetCurrentSite("h2g2");
fullinputcontext.InitUserFromCookie(TestUserAccounts.GetProfileAPITestUserAccount.Cookie, TestUserAccounts.GetProfileAPITestUserAccount.SecureCookie);
User tempUser = new User(fullinputcontext);
tempUser.CreateUser(_testUser.UserID);
Assert.AreEqual(tempUser.UserName, originalUserName);
}
Console.WriteLine("After Test6CheckUserNameChange");
}
示例3: Test8UserListClassTest_AddCurrentUserToList
public void Test8UserListClassTest_AddCurrentUserToList()
{
using (FullInputContext fullinputcontext = new FullInputContext(TestUserAccounts.GetNormalUserAccount.IdentityUserName))
{
fullinputcontext.SetCurrentSite("h2g2");
fullinputcontext.InitUserFromCookie(TestUserAccounts.GetNormalUserAccount.Cookie, TestUserAccounts.GetNormalUserAccount.SecureCookie);
UserList userList = new UserList(fullinputcontext);
Assert.IsTrue(userList.CreateNewUsersList(10, "YEAR", 100, 0, false, "", _InputContext.CurrentSite.SiteID, 0), "Failed creation of list");
Assert.IsTrue(userList.AddCurrentUserToList(), "RemoveUser failed to return");
Assert.IsTrue(userList.FindUserInList(fullinputcontext.ViewingUser.UserID), "Failed to find added user in list");
}
}