Exemplo n.º 1
0
        public Order(string name, bool hasSundae, bool hasSoda)
        {
            if (name == "")
            {
                throw new NameMissing();
            }
            if (hasSundae == false && hasSoda == false)
            {
                throw new NoFood();
            }
            _name = name;

            if (hasSundae)
            {
                _sundae = new Sundae();
            }
            if (hasSoda)
            {
                _soda = new Soda();
            }
        }
Exemplo n.º 2
0
        public Order(string name, bool sundae, bool soda)
        {
            if (String.IsNullOrWhiteSpace(name))
            {
                throw new NameMissing();
            }

            if (sundae == false && soda == false)
            {
                throw new NoFood();
            }

            _name = name;

            if (sundae)
            {
                _sundae = new Sundae();
            }

            if (soda)
            {
                _soda = new Soda();
            }
        }