public void NegativeEarnBaseComTest() { BasePlusCommissionEmployee bCS = new BasePlusCommissionEmployee ("John", "Doe", "123", 500, 0.5m, 1000m); Assert.AreNotEqual(1500, bCS.Earnings()); }
public void Earnings2Test() { BasePlusCommissionEmployee bCS = new BasePlusCommissionEmployee ("John", "Doe", "123", 500, 0.5m, 1000m); Assert.AreEqual(1250, bCS.Earnings()); }
public void BaseSalaryTest() { BasePlusCommissionEmployee bS = new BasePlusCommissionEmployee("John", "Doe", "123", 100, 0.5m, 1000m); Assert.AreEqual(1000, bS.BaseSalary); }
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()); }
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"); } }