예제 #1
0
        public void SomeTypeTest()
        {
            var classOne = new SomeType()
            {
                DateOfBirth = new DateTime(1990, 5, 2),
                ForeName = "David",
                SpecialNumber = 23
            };
            var classTwo = new SomeType()
            {
                DateOfBirth = new DateTime(2000, 11, 22),
                ForeName = "Janet",
                SpecialNumber = 23
            };

            List<String> lstChanges = HelperClass.GetListPropertiesChange(classOne, classTwo);
            Assert.AreEqual(2, lstChanges.Count);
        }
예제 #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;
        }