Ejemplo n.º 1
0
        public void NegativeEarnBaseComTest()
        {
            BasePlusCommissionEmployee bCS = new BasePlusCommissionEmployee
                                                 ("John", "Doe", "123", 500, 0.5m, 1000m);

            Assert.AreNotEqual(1500, bCS.Earnings());
        }
Ejemplo n.º 2
0
        public void Earnings2Test()
        {
            BasePlusCommissionEmployee bCS = new BasePlusCommissionEmployee
                                                 ("John", "Doe", "123", 500, 0.5m, 1000m);

            Assert.AreEqual(1250, bCS.Earnings());
        }
Ejemplo n.º 3
0
        public void BaseSalaryTest()
        {
            BasePlusCommissionEmployee bS =
                new BasePlusCommissionEmployee("John", "Doe", "123", 100, 0.5m, 1000m);

            Assert.AreEqual(1000, bS.BaseSalary);
        }
Ejemplo n.º 4
0
        public void BaseCommToString()
        {
            BasePlusCommissionEmployee bCTS = new BasePlusCommissionEmployee
                                                  ("John", "Doe", "123", 500, 0.5m, 1000m);
            string stringCompare = "base-salaried commission employee: John Doe\n" +
                                   "social security number: 123\ngross sales: $500.00\n" +
                                   "commission rate: 0.50\nbase salary: $1,000.00";

            Assert.AreEqual(stringCompare, bCTS.ToString());
        }
Ejemplo n.º 5
0
        public void BaseSalaryExceptionTest()
        {
            BasePlusCommissionEmployee bS =
                new BasePlusCommissionEmployee("John", "Doe", "123", 100, 0.5m, 1000m);

            Assert.AreEqual(1000, bS.BaseSalary);

            BasePlusCommissionEmployee bS2 =
                new BasePlusCommissionEmployee("John", "Doe", "123", 100, 0.5m, 1000m);

            Assert.AreNotEqual(100, bS2.BaseSalary);

            try
            {
                BasePlusCommissionEmployee bS3 =
                    new BasePlusCommissionEmployee("John", "Doe", "123", 100, 0.5m, -1000m);
            }
            catch (System.ArgumentOutOfRangeException)
            { }
            finally
            {
                Console.WriteLine("out of range");
            }
        }