public void Can_save_and_load_shippingMethod() { var shippingMethod = new ShippingMethod { Name = "Name 1", Description = "Description 1", DisplayOrder = 1 }; var fromDb = SaveAndLoadEntity(shippingMethod); fromDb.ShouldNotBeNull(); fromDb.Name.ShouldEqual("Name 1"); fromDb.Description.ShouldEqual("Description 1"); fromDb.DisplayOrder.ShouldEqual(1); }
public void Can_save_and_load_shippingMethod_with_restriction() { var shippingMethod = new ShippingMethod { Name = "Name 1", DisplayOrder = 1 }; shippingMethod.RestrictedCountries.Add(GetTestCountry()); var fromDb = SaveAndLoadEntity(shippingMethod); fromDb.ShouldNotBeNull(); fromDb.RestrictedCountries.ShouldNotBeNull(); (fromDb.RestrictedCountries.Count == 1).ShouldBeTrue(); fromDb.RestrictedCountries.First().Name.ShouldEqual("United States"); }
public static ShippingMethod ToEntity(this ShippingMethodModel model, ShippingMethod destination) { return Mapper.Map(model, destination); }
/// <summary> /// Updates the shipping method /// </summary> /// <param name="shippingMethod">Shipping method</param> public virtual void UpdateShippingMethod(ShippingMethod shippingMethod) { if (shippingMethod == null) throw new ArgumentNullException("shippingMethod"); _shippingMethodRepository.Update(shippingMethod); //event notification _eventPublisher.EntityUpdated(shippingMethod); }
protected void UpdateLocales(ShippingMethod shippingMethod, ShippingMethodModel model) { foreach (var localized in model.Locales) { _localizedEntityService.SaveLocalizedValue(shippingMethod, x => x.Name, localized.Name, localized.LanguageId); _localizedEntityService.SaveLocalizedValue(shippingMethod, x => x.Description, localized.Description, localized.LanguageId); } }