diff --git a/sharp/content.Tests/DomainTest.cs b/sharp/content.Tests/DomainTest.cs index 3c6582ef..0c3413db 100644 --- a/sharp/content.Tests/DomainTest.cs +++ b/sharp/content.Tests/DomainTest.cs @@ -13,23 +13,22 @@ */ using content.domainservice; - -using JetBrains.Annotations; using Moq; using content.repository; namespace content.Tests; -[TestSubject(typeof(DomainService))] + public class DomainTest { + + private (Mock, Mock userRepo, Mock voteRepo, Mock searchClient) Setup() => + (new Mock(), new Mock(), new Mock(), new Mock(null!)); + [Fact] public async Task FindById_ReturnsVideoDto_WhenVideoExists() { // Arrange - var mockVideoRepo = new Mock(); - var mockUserRepo = new Mock(); - var mockVoteRepo = new Mock(); - var mockSearchClient = new Mock(null); + var (mockVideoRepo, mockUserRepo, mockVoteRepo, mockSearchClient) = Setup(); var video = new Video { Id = 1, UserId = 1 }; var user = new User { Id = "1" }; mockVideoRepo.Setup(repo => repo.FindById(1)).ReturnsAsync(video); @@ -52,10 +51,7 @@ public async Task FindById_ReturnsVideoDto_WhenVideoExists() public async Task FindAllByIds_ReturnsVideoDtos_WhenVideosExist() { // Arrange - var mockVideoRepo = new Mock(); - var mockUserRepo = new Mock(); - var mockVoteRepo = new Mock(); - var mockSearchClient = new Mock(null); + var (mockVideoRepo, mockUserRepo, mockVoteRepo, mockSearchClient) = Setup(); var videos = new List