From a64e1a9433a0d1ae340a38752f8b87cd7df8ad78 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 13 Mar 2021 16:14:42 +0200 Subject: Replaced all "new Guid()" with "Guid.NewGuid()" in service tests --- src/Services/DevHive.Services.Tests/CommentService.Tests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Services/DevHive.Services.Tests/CommentService.Tests.cs') diff --git a/src/Services/DevHive.Services.Tests/CommentService.Tests.cs b/src/Services/DevHive.Services.Tests/CommentService.Tests.cs index d843375..2d3c97a 100644 --- a/src/Services/DevHive.Services.Tests/CommentService.Tests.cs +++ b/src/Services/DevHive.Services.Tests/CommentService.Tests.cs @@ -120,7 +120,7 @@ namespace DevHive.Services.Tests _ = this.UserRepositoryMock.Setup(p => p.GetByIdAsync(It.IsAny())).Returns(Task.FromResult(user)); _ = this.MapperMock.Setup(p => p.Map(It.IsAny())).Returns(commentServiceModel); - ReadCommentServiceModel result = await this.CommentService.GetCommentById(new Guid()); + ReadCommentServiceModel result = await this.CommentService.GetCommentById(Guid.NewGuid()); Assert.AreEqual(MESSAGE, result.Message); } @@ -139,7 +139,7 @@ namespace DevHive.Services.Tests _ = this.CommentRepositoryMock.Setup(p => p.GetByIdAsync(It.IsAny())).Returns(Task.FromResult(comment)); - Exception ex = Assert.ThrowsAsync(() => this.CommentService.GetCommentById(new Guid()), "GetCommentById does not throw exception when the user does not exist"); + Exception ex = Assert.ThrowsAsync(() => this.CommentService.GetCommentById(Guid.NewGuid()), "GetCommentById does not throw exception when the user does not exist"); Assert.AreEqual(EXCEPTION_MESSAGE, ex.Message); } @@ -157,7 +157,7 @@ namespace DevHive.Services.Tests _ = this.CommentRepositoryMock.Setup(p => p.GetByIdAsync(It.IsAny())).Returns(Task.FromResult(null)); _ = this.UserRepositoryMock.Setup(p => p.GetByIdAsync(It.IsAny())).Returns(Task.FromResult(user)); - Exception ex = Assert.ThrowsAsync(() => this.CommentService.GetCommentById(new Guid())); + Exception ex = Assert.ThrowsAsync(() => this.CommentService.GetCommentById(Guid.NewGuid())); Assert.AreEqual(exceptionMessage, ex.Message, "Incorecct exception message"); } -- cgit v1.2.3