mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-23 11:20:05 +02:00
chore: Linux path for fixture fixed
This commit is contained in:
1 parent
a9eab26a6d
commit
7f713e5357
4 files changed
+18
-14
No files matched your search
@@ -46,10 +46,10 @@ namespace WotBlitzStatisticsPro.Tests.OperationStepsTests
|
||||
var accountInfoHistorySerialized = JsonConvert.SerializeObject(_contextData.AccountInfoHistory);
|
||||
|
||||
var expectedAccountInfo =
|
||||
await File.ReadAllTextAsync($"{TestContext.CurrentContext.TestDirectory}\\Fixtures\\MappedAccountInfo.json");
|
||||
await File.ReadAllTextAsync(GetFixturePath("MappedAccountInfo.json"));
|
||||
accountInfoSerialized.Should().Be(expectedAccountInfo);
|
||||
var expectedAccountInfoHistory =
|
||||
await File.ReadAllTextAsync($"{TestContext.CurrentContext.TestDirectory}\\Fixtures\\MappedAccountHistory.json");
|
||||
await File.ReadAllTextAsync(GetFixturePath("MappedAccountHistory.json"));
|
||||
accountInfoHistorySerialized.Should().Be(expectedAccountInfoHistory);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@ namespace WotBlitzStatisticsPro.Tests.OperationStepsTests
|
||||
var tanksHistorySerialized = JsonConvert.SerializeObject(_contextData.TanksHistory);
|
||||
|
||||
var expectedTanksInfo =
|
||||
await File.ReadAllTextAsync($"{TestContext.CurrentContext.TestDirectory}\\Fixtures\\MappedTanks.json");
|
||||
await File.ReadAllTextAsync(GetFixturePath("MappedTanks.json"));
|
||||
tanksSerialized.Should().Be(expectedTanksInfo);
|
||||
var expectedTanksHistory =
|
||||
await File.ReadAllTextAsync($"{TestContext.CurrentContext.TestDirectory}\\Fixtures\\MappedTanksHistory.json");
|
||||
await File.ReadAllTextAsync(GetFixturePath("MappedTanksHistory.json"));
|
||||
tanksHistorySerialized.Should().Be(expectedTanksHistory);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,10 +63,10 @@ namespace WotBlitzStatisticsPro.Tests.OperationStepsTests
|
||||
var settingsMock = new Mock<IWargamingApiSettings>();
|
||||
settingsMock.SetupGet(s => s.ApplicationId).Returns(ApplicationId);
|
||||
|
||||
var playerInfoFilePath = $"{TestContext.CurrentContext.TestDirectory}\\Fixtures\\PlayerInfo50.json";
|
||||
var tanksInfoFilePath = $"{TestContext.CurrentContext.TestDirectory}\\Fixtures\\TanksInfo50.json";
|
||||
var playerAchievementsFilePath = $"{TestContext.CurrentContext.TestDirectory}\\Fixtures\\PlayerAchievements50.json";
|
||||
var tanksAchievementsFilePath = $"{TestContext.CurrentContext.TestDirectory}\\Fixtures\\TanksAchievemnts50.json";
|
||||
var playerInfoFilePath = GetFixturePath("PlayerInfo50.json");
|
||||
var tanksInfoFilePath = GetFixturePath("TanksInfo50.json");
|
||||
var playerAchievementsFilePath = GetFixturePath("PlayerAchievements50.json");
|
||||
var tanksAchievementsFilePath = GetFixturePath("TanksAchievemnts50.json");
|
||||
|
||||
var playerInfoRequestUrl = $"https://api.wotblitz.eu/wotb/account/info/?application_id={ApplicationId}&language=en&account_id={AccountId}";
|
||||
var playerInfoResponse = new HttpResponseMessage
|
||||
@@ -105,7 +105,7 @@ namespace WotBlitzStatisticsPro.Tests.OperationStepsTests
|
||||
|
||||
protected void InitDataAccessors()
|
||||
{
|
||||
var tankopediaFile = File.ReadAllText($"{TestContext.CurrentContext.TestDirectory}\\Fixtures\\Tankopedia.json");
|
||||
var tankopediaFile = File.ReadAllText(GetFixturePath("Tankopedia.json"));
|
||||
var vehicles = JsonConvert.DeserializeObject<List<VehiclesDictionary>>(tankopediaFile);
|
||||
|
||||
var tankTires = vehicles.Select(v => new {TankId = v.TankId, Tier = v.Tier})
|
||||
@@ -122,9 +122,9 @@ namespace WotBlitzStatisticsPro.Tests.OperationStepsTests
|
||||
|
||||
protected void FillAccountAndTanks(AccountInformationPipelineContextData contextData)
|
||||
{
|
||||
var mappedAccountInfoHistory = File.ReadAllText($"{TestContext.CurrentContext.TestDirectory}\\Fixtures\\MappedAccountHistory.json");
|
||||
var mappedTanks = File.ReadAllText($"{TestContext.CurrentContext.TestDirectory}\\Fixtures\\MappedTanks.json");
|
||||
var mappedTanksHistory = File.ReadAllText($"{TestContext.CurrentContext.TestDirectory}\\Fixtures\\MappedTanksHistory.json");
|
||||
var mappedAccountInfoHistory = File.ReadAllText(GetFixturePath("MappedAccountHistory.json"));
|
||||
var mappedTanks = File.ReadAllText(GetFixturePath("MappedTanks.json"));
|
||||
var mappedTanksHistory = File.ReadAllText(GetFixturePath("MappedTanksHistory.json"));
|
||||
|
||||
contextData.AccountInfo = GetAccountInfoFromFixture();
|
||||
contextData.AccountInfoHistory =
|
||||
@@ -137,9 +137,13 @@ namespace WotBlitzStatisticsPro.Tests.OperationStepsTests
|
||||
|
||||
protected AccountInfo GetAccountInfoFromFixture()
|
||||
{
|
||||
var mappedAccountInfo = File.ReadAllText($"{TestContext.CurrentContext.TestDirectory}\\Fixtures\\MappedAccountInfo.json");
|
||||
var mappedAccountInfo = File.ReadAllText(GetFixturePath("MappedAccountInfo.json"));
|
||||
return JsonConvert.DeserializeObject<AccountInfo>(mappedAccountInfo);
|
||||
}
|
||||
|
||||
protected string GetFixturePath(string fixtureFileName)
|
||||
{
|
||||
return Path.Combine(TestContext.CurrentContext.TestDirectory, "Fixtures", fixtureFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -38,7 +38,7 @@ namespace WotBlitzStatisticsPro.Tests.OperationStepsTests
|
||||
var accountInfoSerialized = JsonConvert.SerializeObject(_contextData.DbAccountInfo);
|
||||
|
||||
var expectedAccountInfo =
|
||||
await File.ReadAllTextAsync($"{TestContext.CurrentContext.TestDirectory}\\Fixtures\\MappedAccountInfo.json");
|
||||
await File.ReadAllTextAsync(GetFixturePath("MappedAccountInfo.json"));
|
||||
accountInfoSerialized.Should().Be(expectedAccountInfo);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user