Esempio n. 1
0
        public void StudentAndTeacherTest()
        {
            var classOne = new Student()
            {
                DateOfBirth = DateTime.Now,
                FirstName = "Felippe",
                LastName = "Taschetto",
                NumberOfBrothers = 5,
                Account = new BankAccount()
                {
                    TypeAccount = "Student Account",
                    Tax = 0M,
                    Balance = 1500M
                }
            };

            var classTwo = new Teacher()
            {
                DateOfBirth = new DateTime(1988, 1, 9),
                FirstName = "Leticia",
                LastName = "Taschetto",
                NumberOfBrothers = 10,
                Account = new BankAccount()
                {
                    TypeAccount = "Employee Account",
                    Tax = 5M,
                    Balance = 15000M
                }
            };

            List<String> lstChanges = HelperClass.GetListPropertiesChange(classOne, classTwo);
            Assert.AreEqual(6, lstChanges.Count);
            Assert.AreEqual("First Name changed from 'Felippe' to 'Leticia'.", lstChanges[0]);
        }
Esempio n. 2
0
        private object GetClassCombo(int selectedIndex)
        {
            object classRet;
            if (selectedIndex == 0)
            {
                classRet = new Student()
                {
                    DateOfBirth = new DateTime(1988, 1, 9),
                    FirstName = "Felippe",
                    LastName = "Taschetto",
                    NumberOfBrothers = 5,
                    Account = new BankAccount()
                    {
                        TypeAccount = "Student Account",
                        Tax = 0M,
                        Balance = 1500M
                    }
                };
            }
            else if (selectedIndex == 1)
            {
                classRet = new Teacher()
                {
                    DateOfBirth = new DateTime(1980, 10, 9),
                    FirstName = "Leticia",
                    LastName = "Taschetto",
                    NumberOfBrothers = 10,
                    Account = new BankAccount()
                    {
                        TypeAccount = "Employee Account",
                        Tax = 5M,
                        Balance = 20000M
                    }
                };
            }
            else if (selectedIndex == 2)
            {
                classRet = new BankAccount()
                {
                    TypeAccount = "Manager Account",
                    Tax = 10M,
                    Balance = 15000.50M
                };
            }
            else if (selectedIndex == 3)
            {
                classRet = new SomeType()
                {
                    DateOfBirth = new DateTime(1990, 5, 2),
                    ForeName = "David",
                    SpecialNumber = 23
                };
            }
            else
            {
                classRet = new SomeType()
                {
                    DateOfBirth = new DateTime(2000, 11, 22),
                    ForeName = "Janet",
                    SpecialNumber = 23
                };
            }

            return classRet;
        }