public void EmployeeRepository_Update_InvalidId_ShouldBeFail() { Employee employee = ObjectMotherEmployee.GetEmployee(); Action executeAction = () => _repository.Update(employee); executeAction.Should().Throw <IdentifierUndefinedException>(); }
public void EmployeeRepository_Save_InvalidNullOrEmptyName_ShouldBeFail() { Employee employee = ObjectMotherEmployee.GetEmployeeWithEmptyName(); Action executeAction = () => _repository.Save(employee); executeAction.Should().Throw <EmployeeEmptyOrNullNameException>(); }
public void EmployeeIntegration_Update_InvalidId_ShouldBeFail() { Employee employee = ObjectMotherEmployee.GetEmployee(); Action executeAction = () => _service.Update(employee); executeAction.Should().Throw <IdentifierUndefinedException>(); }
public void EmployeeIntegration_Add_InvalidEmptyOrNullName_ShouldBeFail() { Employee employee = ObjectMotherEmployee.GetEmployeeWithEmptyName(); Action executeAction = () => _service.Add(employee); executeAction.Should().Throw <EmployeeEmptyOrNullNameException>(); }
public void EmployeeService_Update_InvalidId_ShouldBeFail() { Employee employee = ObjectMotherEmployee.GetEmployee(); Action executeAction = () => _service.Update(employee); executeAction.Should().Throw <IdentifierUndefinedException>(); _mockRepository.VerifyNoOtherCalls(); }
public void EmployeeService_Save_InvalidEmptyOrNullName_ShouldBeFail() { Employee employee = ObjectMotherEmployee.GetEmployeeWithEmptyName(); Action executeAction = () => _service.Add(employee); executeAction.Should().Throw <EmployeeEmptyOrNullNameException>(); _mockRepository.VerifyNoOtherCalls(); }
public void EmployeeRepository_Save_ShouldBeOk() { Employee employee = ObjectMotherEmployee.GetEmployee(); Employee result = _repository.Save(employee); result.Should().NotBeNull(); result.Id.Should().BeGreaterThan(0); }
public void EmployeeIntegration_Add_ShouldBeOk() { Employee employee = ObjectMotherEmployee.GetEmployee(); Employee result = _service.Add(employee); result.Should().NotBeNull(); result.Id.Should().BeGreaterThan(0); }
public void Test_Employee_InvalidEmptyOrNullEmployeePosition_ShouldBeFail() { Employee employee = ObjectMotherEmployee.GetEmployeeWithEmptyEmployeePosition(); employee.Id = 0; Action comparison = employee.Validate; comparison.Should().Throw <EmployeeEmptyOrNullEmployeePositionException>(); }
public void Test_Employee_Valid_ShouldBeOk() { Employee employee = ObjectMotherEmployee.GetEmployee(); employee.Id = 0; Action comparison = employee.Validate; comparison.Should().NotThrow <Exception>(); }
public void EmployeeService_Delete_ShouldBeOk() { Employee employee = ObjectMotherEmployee.GetEmployee(); employee.Id = 1; _mockRepository .Setup(m => m.Delete(employee)); _service.Delete(employee); _mockRepository.Verify(m => m.Delete(employee)); }
public void EmployeeService_Update_InvalidEmptyOrNullBranch_ShouldBeFail() { Employee employee = ObjectMotherEmployee.GetEmployeeWithEmptyTelephoneExtension(); employee.Id = 1; Action executeAction = () => _service.Update(employee); executeAction.Should().Throw <EmployeeEmptyOrNullTelephoneExtensionException>(); _mockRepository.VerifyNoOtherCalls(); }
public void EmployeeService_Get_ShouldBeOk() { int id = 1; _mockRepository .Setup(m => m.Get(id)) .Returns(ObjectMotherEmployee.GetEmployee()); Employee employee = _service.Get(id); employee.Should().NotBeNull(); _mockRepository.Verify(m => m.Get(id)); }
public void EmployeeService_Save_ShouldBeOk() { Employee employee = ObjectMotherEmployee.GetEmployee(); _mockRepository .Setup(m => m.Save(employee)) .Returns(new Employee { Id = 1 }); Employee result = _service.Add(employee); result.Should().NotBeNull(); result.Id.Should().BeGreaterThan(0); _mockRepository.Verify(m => m.Save(employee)); }