public void Given_responsibility_not_found_When_CanBeDeleted_Then_log_and_throw_exception() { // Given _responsibilityRepo .Setup(x => x.GetByIdAndCompanyId(_responsibilityId, _companyId)); _target = GetTarget(); // When // Then var e = Assert.Throws<ResponsibilityNotFoundException>(() => _target.GetResponsibility(_responsibilityId, _companyId)); _log.Verify(x => x.Add(e)); }
public void Given_responsibility_When_GetResponsibility_Then_responsibilityDto() { // Given _target = GetTarget(); // When var result = _target.GetResponsibility(_responsibilityId, _companyId); // Then Assert.IsInstanceOf<ResponsibilityDto>(result); Assert.That(result.Id, Is.EqualTo(_responsibility.Id)); Assert.That(result.CompanyId, Is.EqualTo(_companyId)); }