Ejemplo n.º 1
0
        public void SortOrder_FirstName_HasCorrectOrder()
        {
            var objectWeAreTesting = new TextFileBasedEmployeeDatabase(TestEmployees);
            var resultList = objectWeAreTesting.GetEmployeesBySortOrder(SortOrder.AlphabeticalByFirstName);

            String firstName = String.Compare("David",1,"David",5);

            foreach (var employee in resultList)
            {
                Assert.IsTrue(firstName = employee.FirstName);
                firstName = employee.FirstName;
            }
Ejemplo n.º 2
0
        public void SortOrder_BySalary_HasCorrectOrder()
        {
            var objectWeAreTesting = new TextFileBasedEmployeeDatabase(TestEmployees);
            var resultList = objectWeAreTesting.GetEmployeesBySortOrder(SortOrder.BySalary);

            int lastSalary = int.MaxValue;
            foreach (var employee in resultList)
            {
                Assert.IsTrue(lastSalary >= employee.Salary);
                lastSalary = employee.Salary;
            }
          

        }
Ejemplo n.º 3
0
 public void Prop_MaxSalariedEmployee_ReturnsCorrectEmployee()
 {
     var objectWeAreTesting = new TextFileBasedEmployeeDatabase(TestEmployees);
     Assert.AreEqual(150000, objectWeAreTesting.HighestSalariedEmployee.Salary);
 }
Ejemplo n.º 4
0
 public void Remove_IdenticalIds_ThrowsException()
 {
     var objectWeAreTesting = new TextFileBasedEmployeeDatabase(IdenticalIds);
     objectWeAreTesting.Remove(1);
 }
Ejemplo n.º 5
0
 public void Ctor_WithValidLines()
 {
     var objectWeAreTesting = new TextFileBasedEmployeeDatabase(TestEmployees);
     Assert.AreEqual(5, objectWeAreTesting.Employees.Count());
 }