private static TestCaseData GenData(int fullYears) { Organization.Manager managerEmployee = new Organization.Manager("Manager", "Manageroff", DateTime.Now.AddYears(-fullYears), Organization.BASEPAYRATE); TestCaseData data = new TestCaseData(managerEmployee); data.SetName(string.Format(namePattern, fullYears)); data.SetCategory(categoryName); return(data); }
private static TestCaseData GetManagerWithSubordinnatesData(int fullYears, double expectedResult, int[] gruntYears = null, int[] managersYears = null, int[] salesYears = null) { var manager = new Organization.Manager("Manager", "Manageroff", DateTime.Now.AddYears(-fullYears), Organization.BASEPAYRATE); int gruntsCount = 0; int managersCount = 0; int salesCount = 0; if (gruntYears != null) { gruntsCount = gruntYears.Length; foreach (var fullYear in gruntYears) { GetGrunt(fullYear).SetManager(manager); } } if (managersYears != null) { managersCount = managersYears.Length; foreach (var fullYear in managersYears) { GetManager(fullYear).SetManager(manager); } } if (salesYears != null) { salesCount = salesYears.Length; foreach (var fullYear in salesYears) { GetSales(fullYear).SetManager(manager); } } var data = new TestCaseData(manager); data.SetCategory(categoryName); data.SetDescription(string.Format(descriptionPattern, fullYears, gruntsCount, managersCount, salesCount)); data.SetName(string.Format(namePattern, fullYears, gruntsCount + managersCount + salesCount)); data.Returns(expectedResult); return(data); }