Esempio n. 1
0
        static void Main(string[] args)
        {
            var personC1 = new PersonC("yuta1", new DateTime(1987, 8, 8));
            var personC2 = new PersonC("yuta2", new DateTime(1987, 8, 8));

            Console.WriteLine(personC1.Equals(personC2));
            Console.WriteLine(personC1.ToString());

            var personR1 = new PersonR("yuta1", new DateTime(1987, 8, 8));
            var personR2 = new PersonR("yuta2", new DateTime(1987, 8, 8));

            Console.WriteLine(personR1.Equals(personR2));
            Console.WriteLine(personR1.ToString());
        }
Esempio n. 2
0
        public void Refactoring1()
        {
            PersonR p1 = new PersonR()
            {
                Name = "Tom"
            };
            PersonR mannger = new PersonR()
            {
                Name = "Amy"
            };

            p1.SetDepartment(new Refactoring.Department(mannger));

            PersonR except = new PersonR()
            {
                Name = "Amy"
            };
            PersonR reuslt = p1.GetMannager();

            Assert.AreEqual(except.Name, reuslt.Name);
        }