示例#1
0
        private static void Main(string[] args)
        {
            while (true)
            {
                Console.Write("Enter Weight in kg: ");
                var weight = Console.ReadLine();

                if (string.IsNullOrWhiteSpace(weight))
                {
                    Console.Clear();
                    continue;
                }

                Console.Write("Enter Height in cm: ");
                var height = Console.ReadLine();
                if (string.IsNullOrWhiteSpace(height))
                {
                    Console.Clear();
                    continue;
                }

                Console.Write("Enter Width in cm: ");
                var width = Console.ReadLine();
                if (string.IsNullOrWhiteSpace(width))
                {
                    Console.Clear();
                    continue;
                }

                Console.Write("Enter Depth: ");
                var depth = Console.ReadLine();
                if (string.IsNullOrWhiteSpace(depth))
                {
                    Console.Clear();
                    continue;
                }

                Console.WriteLine("-------------------------");

                var box      = new ProductBox(depth.ChangeType <int>(), height.ChangeType <int>(), width.ChangeType <int>());
                var delivery = new DeliveryItem(box, weight.ChangeType <double>());

                delivery.Print();

                Console.ReadKey();
                Console.Clear();
                Thread.Sleep(1000);
            }
        }
示例#2
0
        public void TestMethod4()
        {
            var delivery = new DeliveryItem(new ProductBox(20, 5, 20), 10);

            delivery.Print();
        }
示例#3
0
        public void TestMethod3()
        {
            var delivery = new DeliveryItem(new ProductBox(5, 5, 5), 22);

            delivery.Print();
        }
示例#4
0
        public void TestMethod2()
        {
            var delivery = new DeliveryItem(new ProductBox(12, 10, 3), 2);

            delivery.Print();
        }
示例#5
0
        public void TestMethod1()
        {
            var delivery = new DeliveryItem(new ProductBox(120, 20, 55), 110);

            delivery.Print();
        }