public void AddMerchandiseItemWithFeeAmount(MerchandiseManager.MerchandiseType type, string name, double? fee, double? minFee, double? maxFee) { ClickAddMerchandiseItem (); this.MerchMgr.SetName(name); this.MerchMgr.SetType(type); this.MerchMgr.SetMerchItemPrice(type, fee, minFee, maxFee); this.MerchMgr.SaveAndClose(); }
public void AddMerchandiseItem(MerchandiseManager.MerchandiseType type, string name) { double fee = Math.Round(new Random((int)DateTime.Now.Ticks).NextDouble() * 1000 + 1, 2); double min = Math.Round(new Random((int)DateTime.Now.Ticks).NextDouble() * 50 + 1, 2); double max = Math.Round(new Random((int)DateTime.Now.Ticks).NextDouble() * 1000 + 50 + 1, 2); AddMerchandiseItemWithFeeAmount(type, name, fee, min, max); }
public void AddMerchandiseItemWithMultipleChoiceItem(MerchandiseManager.MerchandiseType type, string name, double? fee, double? minFee, double? maxFee, string[] itemname, int? limit) { ClickAddMerchandiseItem(); this.MerchMgr.SetName(name); this.MerchMgr.SetType(type); this.MerchMgr.SetMerchItemPrice(type, fee, minFee, maxFee); this.MerchMgr.ExpandAdvanced(); for (int i = 0; i < itemname.Length; i++) { this.MerchMgr.AddMerchandiseMultipleChoiceItem(itemname[i], limit); } this.MerchMgr.SaveAndClose(); }
public void VerifyMerchandiseItem(MerchandiseManager.MerchandiseType type, string name) { Fee fee = null; ClientDataContext db = new ClientDataContext(); fee = (from f in db.Fees where f.Description == name && f.AmountTypeId == (int)type orderby f.Id ascending select f).ToList().Last(); Assert.That(fee != null); switch (type) { case MerchandiseManager.MerchandiseType.Fixed: Assert.That(fee.Amount > 0); break; case MerchandiseManager.MerchandiseType.Variable: Assert.That(fee.MinVarAmount > 0); Assert.That(fee.MaxVarAmount > 0); break; } }