public void BossIsAbleToCountSubemployeesTest() { Boss boss = new Boss(new Department()); boss.Add(new Employee()); boss.Add(new Employee()); boss.Add(new Employee()); Assert.AreEqual(3, boss.EmployeeCount); }
public void BossWithTwoSubEmplYearlyIncomeBonusTest() { Boss boss = new Boss(new Department()) { MonthlySalaryCZK = 1000 }; boss.SalaryBonusPerEmployee = 100; boss.Add(new Employee()); boss.Add(new Employee()); Assert.AreEqual((12000 * (1 - Boss.TaxRate)) + (2 * 1200 * (1 - Boss.TaxRate)), boss.CalcYearlyIncome()); }
public void BossCanHaveSubemployeesTest() { Employee empl; Boss boss = new Boss(new Department()); boss.Add(empl = new Employee()); Assert.IsTrue(boss.HasEmployee(empl)); }
public void BossGetsAllEmployees() { Boss boss = new Boss(new Department()); HashSet <Employee> employees = new HashSet <Employee>(); Employee empl1 = new Employee(); Employee empl2 = new Employee(); Employee empl3 = new Employee(); boss.Add(empl1); boss.Add(empl2); boss.Add(empl3); employees.Add(empl1); employees.Add(empl2); employees.Add(empl3); Assert.AreEqual(employees, boss.GetEmployees()); }
public void BossWithoutSubEmplSalaryBonusTest() { Boss boss = new Boss(new Department()) { MonthlySalaryCZK = 1000 }; boss.Add(new Employee()); Assert.AreEqual(12000, boss.CalcYearlySalaryCZK()); }
public void AllEmployeesExportedTest() { Boss exportedBoss = createTestBoss(); Employee exportedEmployee = createTestEmployee(); exportedBoss.Add(exportedEmployee); JsonUtils.Instance.SerializeBossToFile(exportedBoss, TEST_FILE); Boss deserializedBoss = deserializeBossFromTestFileAndDeleteIt(); Assert.AreEqual(1, deserializedBoss.EmployeeCount); }
public void BossIsAbleToKickSubemployeeTest() { Boss boss = new Boss(new Department()); Employee empl = new Employee(); boss.Add(empl); Assert.AreEqual(1, boss.EmployeeCount); Assert.IsTrue(boss.HasEmployee(empl)); boss.Remove(empl); Assert.AreEqual(0, boss.EmployeeCount); }
public void EmployeeExportedCorrectlyTest() { Boss exportedBoss = createTestBoss(); Employee exportedEmployee = createTestEmployee(); exportedBoss.Add(exportedEmployee); JsonUtils.Instance.SerializeBossToFile(exportedBoss, TEST_FILE); Boss deserializedBoss = deserializeBossFromTestFileAndDeleteIt(); Employee deserializedEmployee = deserializedBoss.GetEmployees().First(); Assert.AreEqual(exportedEmployee.ToString(), deserializedEmployee.ToString()); }
// Update is called once per frame void Update() { if (stopped == false) { transform.RotateAround(Boss.transform.position, Vector3.up, 50 * Time.deltaTime); } if (quickTime == true) { //StartCoroutine(resetTime()); } /*if (boss.staggered == false){ * maxDeathTime = 5; * } * * if (stopped == true && boss.staggered == false){ * deathTime += Time.deltaTime; * if (deathTime >= maxDeathTime){ * deathTime = 0; * stopped = false; * health = 5; * boss.Add(1); * sphere.enabled = true; * } * }*/ if (boss.resetDrones == true) { StartCoroutine(enableReset()); } if (boss.staggerTime >= boss.maxStaggerTime) { Debug.Log("yay"); stopped = false; health = 5; boss.Add(1); sphere.enabled = true; } if (health <= minHealth) { health = minHealth; } }
public void EmployeeInsertToBossControlTestCatchArgumentNullException() { Boss boss = new Boss(new Department()); Assert.That(() => boss.Add(null), Throws.ArgumentNullException); }