Ejemplo n.º 1
0
        public ActionResult Index()
        {
            //Начальная инициализация
            vwWallet = new VMWallet(new Dictionary<FaceValueTypes, int>{
                {FaceValueTypes.One,100},
                {FaceValueTypes.Two,100},
                {FaceValueTypes.Five,100},
                {FaceValueTypes.Ten,100}
            });

            userWallet = new Wallet(new Dictionary<FaceValueTypes, int>
            {
                {FaceValueTypes.One,10},
                {FaceValueTypes.Two,30},
                {FaceValueTypes.Five,20},
                {FaceValueTypes.Ten,15}
            });

            productCatalog=new ProductCatalog(new Dictionary<ProductTypes,int>
                {
                    {ProductTypes.Tea,10},
                    {ProductTypes.Coffee,20},
                    {ProductTypes.MilkCoffee,20},
                    {ProductTypes.Juice,15}
                });

            return View();
        }
Ejemplo n.º 2
0
 private Wallet GetInitialCustomerWallet()
 {
     var CustomerWallet = new Wallet();
     CustomerWallet.Coins = new Dictionary<CoinType, int>();
     CustomerWallet.Coins.Add(CoinType.OneCoin, 10);
     CustomerWallet.Coins.Add(CoinType.TwoCoins, 30);
     CustomerWallet.Coins.Add(CoinType.FiveCoins, 20);
     CustomerWallet.Coins.Add(CoinType.TenCoins, 15);
     return CustomerWallet;
 }
Ejemplo n.º 3
0
 private Wallet GetInitialVmWallet()
 {
     var VmWallet = new Wallet();
     VmWallet.Coins = new Dictionary<CoinType, int>();
     VmWallet.Coins.Add(CoinType.OneCoin, 100);
     VmWallet.Coins.Add(CoinType.TwoCoins, 100);
     VmWallet.Coins.Add(CoinType.FiveCoins, 100);
     VmWallet.Coins.Add(CoinType.TenCoins, 100);
     VmWallet.CustomerBalance = 0;
     return VmWallet;
 }
Ejemplo n.º 4
0
 public void SetInitialValues()
 {
     _customerWallet = GetInitialCustomerWallet();
     _vmWallet = GetInitialVmWallet();
     _vmAssortment = GetInitialAssortment();
 }