test: fix AnalyticsServiceTests by mocking missing dependencies and adding moq
This commit is contained in:
@@ -7,6 +7,7 @@ using Predictalytics.Domain.Enums;
|
||||
using Predictalytics.Domain.Interfaces;
|
||||
using Predictalytics.Infrastructure.Data;
|
||||
using Predictalytics.Infrastructure.Data.Repositories;
|
||||
using Moq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -35,17 +36,21 @@ public class AnalyticsServiceTests
|
||||
var tradeRepo = new TradeRepository(db);
|
||||
var marketRepo = new MarketRepository(db);
|
||||
|
||||
var discoveryMock = new MockDiscoveryService();
|
||||
var discoveryMock = new Mock<IDiscoveryService>();
|
||||
var pnlEngineMock = new Mock<IPositionPnLEngine>();
|
||||
var alertRepoMock = new Mock<IAlertRepository>();
|
||||
var watchlistRepoMock = new Mock<IWatchlistRepository>();
|
||||
var providers = new List<IPlatformProvider>();
|
||||
|
||||
var analyticsService = new AnalyticsService(
|
||||
traderRepo,
|
||||
tradeRepo,
|
||||
null!, // alertRepo (not used in GetTraderDeepDiveAsync)
|
||||
null!, // watchlistRepo (not used in GetTraderDeepDiveAsync)
|
||||
alertRepoMock.Object,
|
||||
watchlistRepoMock.Object,
|
||||
marketRepo,
|
||||
discoveryMock,
|
||||
discoveryMock.Object,
|
||||
providers,
|
||||
pnlEngineMock.Object,
|
||||
NullLogger<AnalyticsService>.Instance
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user