aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Tests/DevHive.Data.Tests/PostRepository.Tests.cs
diff options
context:
space:
mode:
authorDanail Dimitrov <danaildimitrov321@gmail.com>2021-01-28 21:25:56 +0200
committerDanail Dimitrov <danaildimitrov321@gmail.com>2021-01-28 21:25:56 +0200
commit6b11b2001a227a09387548853071c63b6fe5c991 (patch)
tree6d9fefe09b31976ac91ea544ee4eb36fc041d8b5 /src/DevHive.Tests/DevHive.Data.Tests/PostRepository.Tests.cs
parent702e947c20cbdc2c5aaacfa0e8172bfc97912dd2 (diff)
downloadDevHive-6b11b2001a227a09387548853071c63b6fe5c991.tar
DevHive-6b11b2001a227a09387548853071c63b6fe5c991.tar.gz
DevHive-6b11b2001a227a09387548853071c63b6fe5c991.zip
Refactored tests after the boys broke them
Diffstat (limited to 'src/DevHive.Tests/DevHive.Data.Tests/PostRepository.Tests.cs')
-rw-r--r--src/DevHive.Tests/DevHive.Data.Tests/PostRepository.Tests.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/DevHive.Tests/DevHive.Data.Tests/PostRepository.Tests.cs b/src/DevHive.Tests/DevHive.Data.Tests/PostRepository.Tests.cs
index 27b7c32..113780b 100644
--- a/src/DevHive.Tests/DevHive.Data.Tests/PostRepository.Tests.cs
+++ b/src/DevHive.Tests/DevHive.Data.Tests/PostRepository.Tests.cs
@@ -62,7 +62,7 @@ namespace DevHive.Data.Tests
{
Post post = await this.AddEntity();
- Post resultPost = await this.PostRepository.GetPostByCreatorAndTimeCreatedAsync(post.CreatorId, post.TimeCreated);
+ Post resultPost = await this.PostRepository.GetPostByCreatorAndTimeCreatedAsync(post.Creator.Id, post.TimeCreated);
Assert.AreEqual(post.Id, resultPost.Id, "GetPostByCreatorAndTimeCreatedAsync does not return the corect post when it exists");
}
@@ -101,11 +101,12 @@ namespace DevHive.Data.Tests
#region HelperMethods
private async Task<Post> AddEntity(string name = POST_MESSAGE)
{
+ User creator = new User { Id = Guid.NewGuid() };
Post post = new Post
{
Message = POST_MESSAGE,
Id = Guid.NewGuid(),
- CreatorId = Guid.NewGuid(),
+ Creator = creator,
TimeCreated = DateTime.Now
};