Example #1
0
        public void TestIfArhitectIsAvtive()
        {
            var arhitect1 = new Arhitect("Luca", "Alexandru", DateTime.Today.AddDays(1), 250);
            var arhitect2 = new Arhitect("Anton", "Vlad", DateTime.Now, 220);

            Assert.True(arhitect1.IsActive());
            Assert.False(arhitect2.IsActive());
        }
Example #2
0
        static void Main(string[] args)
        {
            Arhitect my_tree = new Arhitect();
            int      chose   = 0;

            while (true)
            {
                my_tree.Display();
                Console.WriteLine("Map in you tree");
                my_tree.map_in_my_tree.ForEach(elem => { Console.Write(elem + " "); });
                Console.Write("\n\n");
                Console.Write("Type\n1 - Statistic, 2 - PC," +
                              " 3 - Room, 4 - Table, 5 - Board" +
                              " \n\n1.Go to the branch\n2.leave the branch" +
                              "\n3.Clear map\n4.Add\n5.Remove" +
                              "\n6.All price\n7.Exit\nYour chose:");
                chose = Convert.ToInt32(Console.ReadLine());
                if (chose == 1)
                {
                    Console.Write("Number:");
                    string my_chose = Console.ReadLine();
                    my_tree.map_in_my_tree.Add(my_chose);
                }
                else if (chose == 2)
                {
                    my_tree.map_in_my_tree.RemoveAt(my_tree.map_in_my_tree.Count - 1);
                }
                else if (chose == 3)
                {
                    my_tree.map_in_my_tree.Clear();
                }
                else if (chose == 4)
                {
                    Console.Write("Enter type: ");
                    My_type my_type = (My_type)(Convert.ToInt32(Console.ReadLine()));
                    Console.Write("Enter name: ");
                    string my_chose = Console.ReadLine();
                    Console.Write("Enter price: ");
                    int my_price = Convert.ToInt32(Console.ReadLine());
                    my_tree.Add(my_chose, my_price, my_type);
                }
                else if (chose == 5)
                {
                    my_tree.Remove();
                }
                else if (chose == 6)
                {
                    Console.WriteLine("All price: {0}", my_tree.All_Price());
                    Console.Read();
                }
                else if (chose == 7)
                {
                    break;
                }
                Console.Clear();
            }
        }
Example #3
0
        public void TestIfArhitectFullNameOk()
        {
            var arhitect1 = new Arhitect("Luca", "Alexandru", DateTime.Today.AddDays(1), 250);

            Assert.Equal("Luca Alexandru", arhitect1.GetFullName());
        }