Exemplo n.º 1
0
 public Toy(string title,
     string manufacterer,
     string countryOfManufacturer,
     IMeasuredValue weight,
     IMeasuredValue price,
     ToyTypes type)
     : base(title, manufacterer, countryOfManufacturer, weight, price)
 {
     _Type = type;
 }
Exemplo n.º 2
0
        private void btnDone_Click(object sender, EventArgs e)
        {
            int      selectedType = comboBox.SelectedIndex + 1;
            ToyTypes type         = ToyTypesConverter.ToyTypesDict[selectedType];
            byte     age          = (byte)UpDownAge.Value;
            double   price        = tbPrice.Text != "" ? double.Parse(tbPrice.Text) : 0;

            toy = new Toy(type, age, price);

            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Exemplo n.º 3
0
        private static Toy ToyFromString(string str) //string like "<type>, *<Age>*, *<Price>*"
        {
            string   sType = str.Substring(0, str.IndexOf(',')).Trim();
            ToyTypes type  = (ToyTypes)Enum.Parse(typeof(ToyTypes), sType);

            string temp = str.Substring(str.IndexOf(','), str.LastIndexOf(',')).Trim();
            string sAge = NumberFromString(temp);
            byte   age  = byte.Parse(sAge);

            temp = str.Substring(str.LastIndexOf(',')).Trim();
            string sPrice = NumberFromString(temp);
            double price  = double.Parse(sPrice);

            return(new Toy(type, age, price));
        }
Exemplo n.º 4
0
        public void AddToyType()
        {
repeate:
            Console.WriteLine("--->>Enter ToyType Details<<--");

            Console.WriteLine("Enter ToyType Name: ");
            toyType.ToyTypeName = Console.ReadLine();

            if (toyType.ToyTypeName != null)
            {
                ToyTypes.Add(toyType);
                SaveChanges();
            }
            else
            {
                Console.WriteLine("Enter all requierd data");
                goto repeate;
            }
        }
Exemplo n.º 5
0
 public Order(BurgerTypes burgerType, DrinkTypes drinkType, ToyTypes toyType)
 {
     BurgerType = burgerType;
     DrinkType  = drinkType;
     ToyType    = toyType;
 }
Exemplo n.º 6
0
 public decimal GetToyPrice(ToyTypes type)
 {
     return _toysPriceList[type];
 }
        public void GetToy_returns_burger_having_price_from_BurgerPriceList(ToyTypes type)
        {
            _operations.GetToy(type);

            _mockPriceList.Verify(x => x.GetToyPrice(type), Times.Once());
        }
        public void GetToy_returns_burger_having_specified_type(ToyTypes type)
        {
            var toy = (Toy)_operations.GetToy(type);

            Assert.AreEqual(type, toy.Type);
        }
Exemplo n.º 9
0
 public Toy(ToyTypes type, decimal price)
     : base(price)
 {
     Type = type;
 }
Exemplo n.º 10
0
 public void Change(ToyTypes type, byte age, double price)
 {
     this.Type  = type;
     this.Age   = age;
     this.Price = price;
 }
Exemplo n.º 11
0
 public Order(BurgerTypes burgerType, DrinkTypes drinkType, ToyTypes toyType)
 {
     BurgerType = burgerType;
     DrinkType = drinkType;
     ToyType = toyType;
 }
Exemplo n.º 12
0
 public decimal GetToyPrice(ToyTypes type)
 {
     return(_toysPriceList[type]);
 }
        public void GetToy_returns_burger_having_price_from_BurgerPriceList(ToyTypes type)
        {
            _operations.GetToy(type);

            _mockPriceList.Verify(x => x.GetToyPrice(type), Times.Once());
        }
        public void GetToy_returns_burger_having_specified_type(ToyTypes type)
        {
            var toy = (Toy)_operations.GetToy(type);

            Assert.AreEqual(type, toy.Type);
        }
Exemplo n.º 15
0
 public List <ToyType> GetToyType()
 {
     return(ToyTypes.ToList());
 }
Exemplo n.º 16
0
 public void DeleteToyType(ToyType toyType10)
 {
     ToyTypes.Remove(toyType10);
     SaveChanges();
     Console.WriteLine("ToyTypeId " + toyType10.ToyTypeId + " Deleted");
 }
Exemplo n.º 17
0
 public Toy(ToyTypes type, decimal price)
     : base(price)
 {
     Type = type;
 }
Exemplo n.º 18
0
 public Toy(ToyTypes type, byte age, double price)
 {
     Type  = type;
     Age   = age;
     Price = price;
 }
 public IMealItem GetToy(ToyTypes type)
 {
     // could be: go to the closet and take a toy ...
     return new Toy(type, PriceList.GetToyPrice(type));
 }
Exemplo n.º 20
0
 public IMealItem GetToy(ToyTypes type)
 {
     // could be: go to the closet and take a toy ...
     return(new Toy(type, PriceList.GetToyPrice(type)));
 }