Skip to content

Commit 161d406

Browse files
committed
Add test for BotRepository
1 parent 77e62b2 commit 161d406

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using AutoFixture.Xunit2;
2+
using FluentAssertions;
3+
using Moq;
4+
using RealTimeWeatherMonitoringApp.Domain.Models;
5+
using RealTimeWeatherMonitoringApp.Infrastructure.Interfaces;
6+
using RealTimeWeatherMonitoringApp.Infrastructure.Repository;
7+
using RealTimeWeatherMonitoringTest.Common;
8+
using RealTimeWeatherMonitoringTest.Domain.Models;
9+
using Xunit;
10+
11+
namespace RealTimeWeatherMonitoringTest.Infrastructure.Repository;
12+
13+
public class BotRepositoryShould
14+
{
15+
[Theory, AutoMoqData]
16+
public void GetAll_GetAllBotsFromBotInitializer(
17+
List<Bot<TestData>> initializedBots,
18+
[Frozen] Mock<IBotInitializer<TestData>> botInitializerMock,
19+
BotRepository<TestData> botRepository)
20+
{
21+
botInitializerMock.Setup(i => i.InitializeAndGetAllBots()).Returns(initializedBots);
22+
23+
var bots = botRepository.GetAll();
24+
25+
bots.Should().BeEquivalentTo(initializedBots);
26+
}
27+
}

0 commit comments

Comments
 (0)