public IUser GetApplicationUser(IUserContext appUserContext, IDataContext dataContext) { UpdateInformation updateInformation = new UpdateInformation(); updateInformation.CreatedBy = AnalysisPortalTestSettings.Default.TestUserId + 1; updateInformation.CreatedDate = DateTime.Now; updateInformation.ModifiedBy = AnalysisPortalTestSettings.Default.TestUserId + 1; updateInformation.ModifiedDate = DateTime.Now; IUser appUser = new ArtDatabanken.Data.Fakes.StubIUser() { UserNameGet = () => { return(AnalysisPortalTestSettings.Default.TestUserName + "Appuser"); }, ApplicationIdGet = () => { return(AnalysisPortalTestSettings.Default.TestnAnalysisPortalApplcationId); }, IsAccountActivatedGet = () => { return(true); }, EmailAddressGet = () => { return(AnalysisPortalTestSettings.Default.TestUserEmail + "Appuser"); }, DataContextGet = () => { return(dataContext); }, GUIDGet = () => { return(AnalysisPortalTestSettings.Default.TestUserGuid + "Appuser"); }, IdGet = () => { return(AnalysisPortalTestSettings.Default.TestUserId + 1); }, ShowEmailAddressGet = () => { return(true); }, TypeGet = () => { return(UserType.Person); }, UpdateInformationGet = () => { return(updateInformation); }, ValidFromDateGet = () => { return(DateTime.Now); }, ValidToDateGet = () => { return(new DateTime(2144, 12, 31)); } }; return(appUser); }
public IUser GetUser(IUserContext testUserContext, IDataContext dataContext, bool multipleUsers = false) { int id = AnalysisPortalTestSettings.Default.TestUserId; if (multipleUsers) { id = id + 1; } UpdateInformation updateInformation = new UpdateInformation(); updateInformation.CreatedBy = AnalysisPortalTestSettings.Default.TestUserId; updateInformation.CreatedDate = DateTime.Now; updateInformation.ModifiedBy = AnalysisPortalTestSettings.Default.TestUserId; updateInformation.ModifiedDate = DateTime.Now; IUser testUser = new ArtDatabanken.Data.Fakes.StubIUser() { UserNameGet = () => { return(AnalysisPortalTestSettings.Default.TestUserName); }, ApplicationIdGet = () => { return(AnalysisPortalTestSettings.Default.TestnAnalysisPortalApplcationId); }, IsAccountActivatedGet = () => { return(true); }, EmailAddressGet = () => { return(AnalysisPortalTestSettings.Default.TestUserEmail); }, DataContextGet = () => { return(dataContext); }, GUIDGet = () => { return(AnalysisPortalTestSettings.Default.TestUserGuid); }, IdGet = () => { return(id); }, ShowEmailAddressGet = () => { return(true); }, TypeGet = () => { return(UserType.Person); }, UpdateInformationGet = () => { return(updateInformation); }, ValidFromDateGet = () => { return(DateTime.Now); }, ValidToDateGet = () => { return(new DateTime(2144, 12, 31)); } }; return(testUser); }