From 6b11b2001a227a09387548853071c63b6fe5c991 Mon Sep 17 00:00:00 2001 From: Danail Dimitrov Date: Thu, 28 Jan 2021 21:25:56 +0200 Subject: Refactored tests after the boys broke them --- src/DevHive.Tests/DevHive.Data.Tests/CommentRepository.Tests.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/DevHive.Tests/DevHive.Data.Tests/CommentRepository.Tests.cs') 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 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 }; -- cgit v1.2.3