Website Summary Files Commits Branches @commit @diff @stats
path: root / src / DevHive.Tests / DevHive.Data.Tests / CommentRepository.Tests.cs
diff options
context:
space:
mode:
Commit6b11b2001a227a09387548853071c63b6fe5c991 (patch)
Author
 Danail Dimitrov <danaildimitrov321@gmail.com>
2021-01-28 21:25:56 +0200
Committer
 Danail Dimitrov <danaildimitrov321@gmail.com>
2021-01-28 21:25:56 +0200
Files6d9fefe09b31976ac91ea544ee4eb36fc041d8b5 /src/DevHive.Tests/DevHive.Data.Tests/CommentRepository.Tests.cs
DevHive-6b11b2001a227a09387548853071c63b6fe5c991.tar
DevHive-6b11b2001a227a09387548853071c63b6fe5c991.tar.gz
DevHive-6b11b2001a227a09387548853071c63b6fe5c991.zip
Parent702e947c20cbdc2c5aaacfa0e8172bfc97912dd2 (diff)
Refactored tests after the boys broke them
1 files changed, 3 insertions, 2 deletions
-rw-r--r--src/DevHive.Tests/DevHive.Data.Tests/CommentRepository.Tests.cs5
diff --git a/src/DevHive.Tests/DevHive.Data.Tests/CommentRepository.Tests.cs b/src/DevHive.Tests/DevHive.Data.Tests/CommentRepository.Tests.cs
index 2a8bb1f..9cbb43b 100644
--- a/src/DevHive.Tests/DevHive.Data.Tests/CommentRepository.Tests.cs
+++ b/src/DevHive.Tests/DevHive.Data.Tests/CommentRepository.Tests.cs
@@ -41,7 +41,7 @@ namespace DevHive.Data.Tests
{
Comment comment = await this.AddEntity();
- Comment resultComment = await this.CommentRepository.GetCommentByIssuerAndTimeCreatedAsync(comment.CreatorId, comment.TimeCreated);
+ Comment resultComment = await this.CommentRepository.GetCommentByIssuerAndTimeCreatedAsync(comment.Creator.Id, comment.TimeCreated);
Assert.AreEqual(comment.Id, resultComment.Id, "GetCommentByIssuerAndTimeCreatedAsync does not return the corect comment when it exists");
}
@@ -81,10 +81,11 @@ namespace DevHive.Data.Tests
#region HelperMethods
private async Task<Comment> AddEntity(string name = COMMENT_MESSAGE)
{
+ User creator = new User { Id = Guid.NewGuid() };
Comment comment = new Comment
{
Message = COMMENT_MESSAGE,
- CreatorId = Guid.NewGuid(),
+ Creator = creator,
TimeCreated = DateTime.Now
};