Skip to content

Commit

Permalink
Created Unit Test for the GetEmployees_WhenCalled_ShouldReturnIEnumer…
Browse files Browse the repository at this point in the history
…ableOfEmployeeDto Method

More details can be found at #5.
  • Loading branch information
Josh Samuel O. Monreal committed Jan 31, 2019
1 parent 155f8b3 commit e456fa9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Tests/RP.UnitTests/EmployeeBusinessTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using RP.Business.Profiles;
using RP.DataAccess.RepositoryPattern.Core;
using RP.DataAccess.RepositoryPattern.Entities;
using System.Collections.Generic;

namespace RP.UnitTests
{
Expand Down Expand Up @@ -89,9 +90,15 @@ public void GetEmployeeById_EmployeeExists_ReturnsEmployeeWithFirstNameOfJohn()
}

[Test]
public void GetEmployees_WhenCalled_ShouldReturnListOfEmployees()
public void GetEmployees_WhenCalled_ShouldReturnIEnumerableOfEmployeeDto()
{
_unitOfWork.Setup(uow => uow.Employees.GetAll())
.Returns(new List<Employee> { _employee });
_business = new EmployeeBusiness(_unitOfWork.Object);

var result = _business.GetEmployees();

Assert.That(result, Is.InstanceOf(typeof(IEnumerable<EmployeeDto>)));
}
}
}

0 comments on commit e456fa9

Please sign in to comment.