public static void MyClassInitialize(TestContext testContext) { kernel = TestManager.ConfigureNInjectKernel(); userProfileDao = kernel.Get <IUserProfileDao>(); creditCardDao = kernel.Get <ICreditCardDao>(); deliveryDao = kernel.Get <IDeliveryDao>(); }
public static void MyClassInitialize(TestContext testContext) { kernel = TestManager.ConfigureNInjectKernel(); userProfileDao = kernel.Get <IUserProfileDao>(); userService = kernel.Get <IUserService>(); }
public static void MyClassInitialize(TestContext testContext) { Console.WriteLine(Assembly.GetExecutingAssembly().ToString()); container = TestManager.ConfigureUnityContainer("unity"); userProfileDao = container.Resolve<IUserProfileDao>(); userService = container.Resolve<IUserService>(); }
/// <summary> /// Returns the collection of settings property values for the specified application instance and settings property /// group. /// </summary> /// <returns> /// A <see cref="T:System.Configuration.SettingsPropertyValueCollection"></see> containing the values for the specified /// settings property group. /// </returns> /// <param name="context"> /// A <see cref="T:System.Configuration.SettingsContext"></see> describing the current application use. /// </param> /// <param name="collection"> /// A <see cref="T:System.Configuration.SettingsPropertyCollection"></see> containing the settings property group whose /// values are to be retrieved. /// </param> /// <filterpriority>2</filterpriority> public override SettingsPropertyValueCollection GetPropertyValues(SettingsContext context, SettingsPropertyCollection collection) { SessionWrapper sessionWrapper = SessionManager.GetSessionWrapper(); IUserProfileDao profileDao = MemberShipFactory.CreateProfileDao(); try { var result = new SettingsPropertyValueCollection(); Dictionary <string, object> persisteProfileValue = null; string userName = LoginId(context); ProfileValue profileValue = profileDao.FindByLoginId(userName); if (profileValue != null) { persisteProfileValue = profileValue.Properities; } foreach (SettingsProperty property in collection) { var item = new SettingsPropertyValue(property); if (persisteProfileValue != null && persisteProfileValue.ContainsKey(item.Name)) { item.PropertyValue = persisteProfileValue[item.Name]; } result.Add(item); } sessionWrapper.Commit(); return(result); } finally { sessionWrapper.Close(); } }
public static void MyClassInitialize(TestContext testContext) { kernel = TestManager.ConfigureNInjectKernel(); productDao = kernel.Get <IProductDao>(); categoryDao = kernel.Get <ICategoryDao>(); commentDao = kernel.Get <ICommentDao>(); userProfileDao = kernel.Get <IUserProfileDao>(); }
public void NinjectTestMethod() { //kernel = TestManager.ConfigureNInjectKernel("./Modules/ninjectConfiguration.xml"); kernel = TestManager.ConfigureNInjectKernel(); IUserProfileDao dao = kernel.Get <IUserProfileDao>(); Assert.IsInstanceOfType(dao, typeof(IUserProfileDao)); }
public static void MyClassInitialize(TestContext testContext) { kernel = TestManager.ConfigureNInjectKernel(); eventDao = kernel.Get <IEventDao>(); categoryDao = kernel.Get <ICategoryDao>(); commentDao = kernel.Get <ICommentDao>(); userProfileDao = kernel.Get <IUserProfileDao>(); labelDao = kernel.Get <ILabelDao>(); eventService = kernel.Get <IEventService>(); }
public static void MyClassInitialize(TestContext testContext) { kernel = TestManager.ConfigureNInjectKernel(); shoppingService = kernel.Get <IShoppingService>(); userProfileDao = kernel.Get <IUserProfileDao>(); creditCardDao = kernel.Get <ICreditCardDao>(); categoryDao = kernel.Get <ICategoryDao>(); productDao = kernel.Get <IProductDao>(); }
public static void MyClassInitialize(TestContext testContext) { container = TestManager.ConfigureUnityContainer("unity"); opinadorService = container.Resolve <IOpinadorService>(); userProfileDao = container.Resolve <IUserProfileDao>(); valoracionDao = container.Resolve <IValoracionDao>(); comentarioDao = container.Resolve <IComentarioDao>(); etiquetaDao = container.Resolve <IEtiquetaDao>(); favoritoDao = container.Resolve <IFavoritoDao>(); }
public UserController(ICommandBus bus, IFileTempDao fileTemp, IUserDao userDao, IUserProfileDao userProfileDao, IUserStatusDao userStatusDao) : base() { this.bus = bus; this._UserDao = userDao; this._UserProfileDao = userProfileDao; this._UserStatusDao = userStatusDao; this._FileTemp = fileTemp; this._listFileTemp = new List <int>(); _storage = new Storage.StorageClient(CustomConfiguration.Storage); _containerName = CustomConfiguration.ContainerName; }
public static void MyClassInitialize(TestContext testContext) { kernel = TestManager.ConfigureNInjectKernel(); recommendationGroupService = kernel.Get <IRecommendationGroupService>(); userService = kernel.Get <IUserService>(); userProfileDao = kernel.Get <IUserProfileDao>(); sportEventDao = kernel.Get <ISportEventDao>(); recommendationDao = kernel.Get <IRecommendationDao>(); groupUsersDao = kernel.Get <IGroupUsersDao>(); sportEventService = kernel.Get <ISportEventService>(); categoryDao = kernel.Get <ICategoryDao>(); }
public static void MyClassInitialize(TestContext testContext) { kernel = TestManager.ConfigureNInjectKernel(); productDao = kernel.Get <IProductDao>(); categoryDao = kernel.Get <ICategoryDao>(); specificPropertyDao = kernel.Get <ISpecificPropertyDao>(); commentDao = kernel.Get <ICommentDao>(); tagDao = kernel.Get <ITagDao>(); userDao = kernel.Get <IUserProfileDao>(); productService = kernel.Get <IProductService>(); }
public static void MyClassInitialize(TestContext testContext) { Console.WriteLine(Assembly.GetExecutingAssembly().ToString()); container = TestManager.ConfigureUnityContainer("unity"); userProfileDao = container.Resolve<IUserProfileDao>(); userService = container.Resolve<IUserService>(); userGroupDao = container.Resolve<IUserGroupDao>(); userGroupService = container.Resolve<IUserGroupService>(); recomendationDao = container.Resolve<IRecomendationDao>(); recomendationService = container.Resolve<IRecomendationService>(); eventDao = container.Resolve<IEventDao>(); eventService = container.Resolve<IEventService>(); categoryDao = container.Resolve<ICategoryDao>(); }
public static void MyClassInitialize(TestContext testContext) { kernel = TestManager.ConfigureNInjectKernel(); categoryDao = kernel.Get <ICategoryDao>(); cardDao = kernel.Get <ICardDao>(); userDao = kernel.Get <IUserProfileDao>(); productDao = kernel.Get <IProductDao>(); orderDao = kernel.Get <IOrderDao>(); orderLineDao = kernel.Get <IOrderLineDao>(); orderService = kernel.Get <IOrderService>(); userService = kernel.Get <IUserService>(); cardService = kernel.Get <ICardService>(); productService = kernel.Get <IProductService>(); }
private void Profile_MigrateAnonymous(object sender, ProfileMigrateEventArgs args) { SessionWrapper wrapper = SessionManager.GetSessionWrapper(); try { IUserProfileDao profileDao = OrnamentContext.DaoFactory.MemberShipFactory.CreateProfileDao(); ProfileValue anonymous = profileDao.FindByLoginId(args.AnonymousID); if (anonymous != null) { //合并anonymous profile ProfileBase currenProfile = HttpContext.Current.Profile; foreach (string key in anonymous.Properities.Keys) { currenProfile.SetPropertyValue(key, anonymous.Properities[key]); } profileDao.Delete(anonymous); currenProfile.Save(); AnonymousIdentificationModule.ClearAnonymousIdentifier(); } //最后,一更新Multi-lang的cookie,因此使用Profile的语言。 OrnamentContext.MemberShip.SwitchLanguage(OrnamentContext.MemberShip.CurrentUser().GetLanguage()); wrapper.Commit(); } catch (Exception ex) { ILog log = LogManager.GetLogger(typeof(GlobalContext)); log.Error(ex.Message, ex); } finally { wrapper.Close(); } }
/// <summary> /// Sets the values of the specified group of property settings. /// </summary> /// <param name="context"> /// A <see cref="T:System.Configuration.SettingsContext"></see> describing the current application usage. /// </param> /// <param name="collection"> /// A <see cref="T:System.Configuration.SettingsPropertyValueCollection"></see> representing the group of property /// settings to set. /// </param> /// <filterpriority>2</filterpriority> public override void SetPropertyValues(SettingsContext context, SettingsPropertyValueCollection collection) { SessionWrapper sessionWrapper = SessionManager.GetSessionWrapper(); try { string userName = LoginId(context); IUserProfileDao profileDao = MemberShipFactory.CreateProfileDao(); ProfileValue profileValue = profileDao.FindByLoginId(userName) ?? new ProfileValue { LastActivityDate = DateTime.Now, IsAnonymous = !userIsAuthenticated(context), LoginId = userName }; foreach (SettingsPropertyValue settingsPropertyValue in collection) { if (profileValue.Properities.ContainsKey(settingsPropertyValue.Name)) { profileValue.Properities[settingsPropertyValue.Name] = settingsPropertyValue.PropertyValue; } else { profileValue.Properities.Add(settingsPropertyValue.Name, settingsPropertyValue.PropertyValue); } } profileDao.SaveOrUpdate(profileValue); sessionWrapper.Commit(); } finally { sessionWrapper.Close(); } }
public static void MyClassInitialize(TestContext testContext) { container = TestManager.ConfigureUnityContainer("unity"); userService = container.Resolve <IUserService>(); userProfileDao = container.Resolve <IUserProfileDao>(); }
public static void MyClassInitialize(TestContext testContext) { container = TestManager.ConfigureUnityContainer("unity"); userService = container.Resolve<IUserService>(); userProfileDao = container.Resolve<IUserProfileDao>(); }