diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-03-13 16:14:42 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-03-13 16:14:42 +0200 |
| commit | a64e1a9433a0d1ae340a38752f8b87cd7df8ad78 (patch) | |
| tree | 1f3acb3ff754d2f4a775fe935f80e584f9062c9e /src/Services/DevHive.Services.Tests/CommentService.Tests.cs | |
| parent | e725d029bcd05f9c945312a3c931064a14d2bd5e (diff) | |
| download | DevHive-a64e1a9433a0d1ae340a38752f8b87cd7df8ad78.tar DevHive-a64e1a9433a0d1ae340a38752f8b87cd7df8ad78.tar.gz DevHive-a64e1a9433a0d1ae340a38752f8b87cd7df8ad78.zip | |
Replaced all "new Guid()" with "Guid.NewGuid()" in service tests
Diffstat (limited to 'src/Services/DevHive.Services.Tests/CommentService.Tests.cs')
| -rw-r--r-- | src/Services/DevHive.Services.Tests/CommentService.Tests.cs | 6 |
1 files changed, 3 insertions, 3 deletions
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<Guid>())).Returns(Task.FromResult(user)); _ = this.MapperMock.Setup(p => p.Map<ReadCommentServiceModel>(It.IsAny<Comment>())).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<Guid>())).Returns(Task.FromResult(comment)); - Exception ex = Assert.ThrowsAsync<ArgumentException>(() => this.CommentService.GetCommentById(new Guid()), "GetCommentById does not throw exception when the user does not exist"); + Exception ex = Assert.ThrowsAsync<ArgumentException>(() => 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<Guid>())).Returns(Task.FromResult<Comment>(null)); _ = this.UserRepositoryMock.Setup(p => p.GetByIdAsync(It.IsAny<Guid>())).Returns(Task.FromResult(user)); - Exception ex = Assert.ThrowsAsync<ArgumentException>(() => this.CommentService.GetCommentById(new Guid())); + Exception ex = Assert.ThrowsAsync<ArgumentException>(() => this.CommentService.GetCommentById(Guid.NewGuid())); Assert.AreEqual(exceptionMessage, ex.Message, "Incorecct exception message"); } |
