Skip to content

Commit

Permalink
test corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinleighsmith committed Oct 31, 2023
1 parent 31a95e6 commit 01983ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ public void GetPimsDocumentTypes_PropertyActivity_Success()
var service = this.CreateDocumentFileServiceWithPermissions(Permissions.DocumentView, Permissions.ManagementView);
var propertyActivityFileDocumentRepository = this._helper.GetService<Mock<IPropertyActivityDocumentRepository>>();

propertyActivityFileDocumentRepository.Setup(x => x.GetAllByPropertyActivityFile(It.IsAny<long>())).Returns(new List<PimsPropertyActivityDocument>());
propertyActivityFileDocumentRepository.Setup(x => x.GetAllByPropertyActivity(It.IsAny<long>())).Returns(new List<PimsPropertyActivityDocument>());

// Act
var sut = service.GetFileDocuments<PimsResearchFileDocument>(Constants.FileType.Management, 1);

// Assert
propertyActivityFileDocumentRepository.Verify(x => x.GetAllByPropertyActivityFile(It.IsAny<long>()), Times.Once);
propertyActivityFileDocumentRepository.Verify(x => x.GetAllByPropertyActivity(It.IsAny<long>()), Times.Once);
}

[Fact]
Expand Down Expand Up @@ -164,13 +164,13 @@ public void GetAllDocuments_PropertyActivity_Success()
var service = this.CreateDocumentFileServiceWithPermissions(Permissions.DocumentView, Permissions.ManagementView);
var propertyActivityDocumentRepository = this._helper.GetService<Mock<IPropertyActivityDocumentRepository>>();

propertyActivityDocumentRepository.Setup(x => x.GetAllByPropertyActivityFile(It.IsAny<long>())).Returns(new List<PimsPropertyActivityDocument>());
propertyActivityDocumentRepository.Setup(x => x.GetAllByPropertyActivity(It.IsAny<long>())).Returns(new List<PimsPropertyActivityDocument>());

// Act
var sut = service.GetFileDocuments<PimsLeaseDocument>(Constants.FileType.Management, 1);

// Assert
propertyActivityDocumentRepository.Verify(x => x.GetAllByPropertyActivityFile(It.IsAny<long>()), Times.Once);
propertyActivityDocumentRepository.Verify(x => x.GetAllByPropertyActivity(It.IsAny<long>()), Times.Once);
}

[Fact]
Expand Down Expand Up @@ -566,7 +566,7 @@ public async void DeleteDocumentPropertyActivity_Success_NoResults_Status_NotFou
var documentService = this._helper.GetService<Mock<IDocumentService>>();
var propertyActivityDocumentRepository = this._helper.GetService<Mock<IPropertyActivityDocumentRepository>>();

propertyActivityDocumentRepository.Setup(x => x.GetAllByPropertyActivityFile(It.IsAny<long>())).Returns(new List<PimsPropertyActivityDocument>());
propertyActivityDocumentRepository.Setup(x => x.GetAllByPropertyActivity(It.IsAny<long>())).Returns(new List<PimsPropertyActivityDocument>());
documentService.Setup(x => x.DeleteDocumentAsync(It.IsAny<PimsDocument>()))
.ReturnsAsync(new ExternalResult<string>()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void GetAllByPropertyActivity_Success()
var repository = helper.CreateRepository<PropertyActivityDocumentRepository>(user);

// Act
var result = repository.GetAllByPropertyActivityFile(propertyActivityFileDocument.PimsPropertyActivityId);
var result = repository.GetAllByPropertyActivity(propertyActivityFileDocument.PimsPropertyActivityId);

// Assert
result.FirstOrDefault().Internal_Id.Should().Be(1);
Expand Down

0 comments on commit 01983ab

Please sign in to comment.