本文整理汇总了C#中Facade.GetUserGuidFromUserName方法的典型用法代码示例。如果您正苦于以下问题:C# Facade.GetUserGuidFromUserName方法的具体用法?C# Facade.GetUserGuidFromUserName怎么用?C# Facade.GetUserGuidFromUserName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Facade
的用法示例。
在下文中一共展示了Facade.GetUserGuidFromUserName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: User_can_signup_and_have_registered_user_template_tabs
public void User_can_signup_and_have_registered_user_template_tabs()
{
var facade = default(Facade);
var anonUserProfile = default(UserProfile);
var newlyAddedWidgetId = default(int);
var registeredUserName = default(string);
var registeredUserPassword = default(string);
var regUserName = default(string);
var regUserTabs = default(List<Tab>);
"Given registered user template is on and an anonymous user who has made some changes to the page".Context(() =>
{
anonUserProfile = MembershipHelper.CreateNewAnonUser();
facade = new Facade(new Context.AppContext(anonUserProfile.UserName, anonUserProfile.UserName));
var userSetup = facade.FirstVisitHomeTab(anonUserProfile.UserName, string.Empty, true, false);
var newWidgetToAdd = facade.GetWidgetList(anonUserProfile.UserName, Data.Enumerations.WidgetType.PersonalTab).First();
var newlyAddedWidget = facade.AddWidgetInstance(newWidgetToAdd.ID, 0, 0, 0);
newlyAddedWidgetId = newlyAddedWidget.Id;
// Load the anonymous user pages and widgets
regUserName = facade.GetUserSettingTemplate().RegisteredUserSettingTemplate.UserName;
regUserTabs = facade.GetTabsOfUser(facade.GetUserGuidFromUserName(regUserName));
});
"When user signs up".Do(() =>
{
registeredUserName = Guid.NewGuid().ToString();
registeredUserPassword = Guid.NewGuid().ToString();
facade.RegisterUser(registeredUserName, registeredUserPassword, registeredUserName, false);
});
"It should replace the users tabs with the tabs and widgets of the registered user template".Assert(() =>
{
var revisitModel = facade.RepeatVisitHomeTab(registeredUserName, string.Empty, false, false);
regUserTabs.Each(regTab =>
{
var userTab = revisitModel.UserTabs.First(page =>
page.Title == regTab.Title
&& page.OrderNo == regTab.OrderNo
&& page.PageType == regTab.PageType);
facade.GetColumnsInTab(regTab.ID).Each(regColumn =>
{
var userColumns = facade.GetColumnsInTab(userTab.ID);
var userColumn = userColumns.First(column =>
column.ColumnNo == regColumn.ColumnNo);
var anonColumnWidgets = facade.GetWidgetInstancesInZoneWithWidget(regColumn.WidgetZone.ID);
var userColumnWidgets = facade.GetWidgetInstancesInZoneWithWidget(userColumn.WidgetZone.ID);
// Ensure the widgets from the anonymous user template's columns are
// in the same column and row.
anonColumnWidgets.Each(anonWidget => Assert.True(userColumnWidgets.Where(userWidget =>
userWidget.Title == anonWidget.Title
&& userWidget.Expanded == anonWidget.Expanded
&& userWidget.State == anonWidget.State
&& userWidget.Resized == anonWidget.Resized
&& userWidget.Height == anonWidget.Height
&& userWidget.OrderNo == anonWidget.OrderNo).Count() == 1));
});
});
});
"It should allow user to login to access the pages".Assert(() =>
{
Assert.True(facade.Login(registeredUserName, registeredUserPassword));
});
}