feat: introduced caching in the server + Added serilog

This commit is contained in:
Mikhail Shabanov committed 2021-06-04 23:04:03 +02:00
1 parent 8c9770f8a0
commit 638489a842
25 files changed
+365 -33

No files matched your search

@@ -8,6 +8,7 @@ using NUnit.Framework;
using WotBlitzStatisticsPro.Logic.AccountInformationPipeline;
using WotBlitzStatisticsPro.Logic.AccountInformationPipeline.OperationContext;
using WotBlitzStatisticsPro.Logic.AccountInformationPipeline.Operations;
using WotBlitzStatisticsPro.Logic.Model;
namespace WotBlitzStatisticsPro.Tests.OperationStepsTests
{
@@ -16,16 +17,21 @@ namespace WotBlitzStatisticsPro.Tests.OperationStepsTests
{
private GetTanksInfoOperation _operation;
private AccountInformationPipelineContextData _contextData;
private StatisticsCache _cache;
[SetUp]
public void Init()
{
InitAutoMapper();
InitWgApiClient();
_cache = new StatisticsCache();
_operation = new GetTanksInfoOperation(
WargamingTanksApiClient,
Mapper,
(new Mock<ILogger<GetTanksInfoOperation>>()).Object);
(new Mock<ILogger<GetTanksInfoOperation>>()).Object,
_cache);
_contextData = new AccountInformationPipelineContextData();
}
@@ -50,6 +56,21 @@ namespace WotBlitzStatisticsPro.Tests.OperationStepsTests
var expectedTanksHistory =
await File.ReadAllTextAsync(GetFixturePath("MappedTanksHistory.json"));
tanksHistorySerialized.Should().Be(expectedTanksHistory);
// ToDo: Check cache
Assert.Fail("Implement test");
}
[Test]
public async Task ShouldGetAndSaveTankInfoInformationIfCacheExpired()
{
Assert.Fail("Implement test");
}
[Test]
public async Task ShouldReadDataFromCacheIfItIsNotEmpty()
{
Assert.Fail("Implement test");
}
}