Skip to content

Commit

Permalink
Process region and DC history when batching requests (#1343)
Browse files Browse the repository at this point in the history
  • Loading branch information
karashiiro authored Jul 21, 2024
1 parent 86738ae commit c2aa639
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static TestResources Create()
}
}

[Theory(Skip = "Testing without history")]
[Theory]
[InlineData("74")]
[InlineData("Coeurl")]
[InlineData("coEUrl")]
Expand Down Expand Up @@ -112,7 +112,7 @@ public async Task Controller_Get_ReturnsOne_WithEntries(string worldOrDc)
Assert.True(currentlyShown.Listings.Count > 1);
}

[Theory(Skip = "Testing without history")]
[Theory]
[InlineData("74")]
[InlineData("Coeurl")]
[InlineData("coEUrl")]
Expand Down Expand Up @@ -147,7 +147,7 @@ public async Task Controller_Get_Succeeds_MultiItem_World(string worldOrDc)
AssertCurrentlyShownValidWorld(document2, sales2, currentlyShown.Items.First(item => item.ItemId == document2.ItemId), test.GameData);
}

[Theory(Skip = "Testing without history")]
[Theory]
[InlineData("crystaL")]
[InlineData("Crystal")]
public async Task Controller_Get_Succeeds_SingleItem_DataCenter(string worldOrDc)
Expand Down Expand Up @@ -187,7 +187,7 @@ public async Task Controller_Get_Succeeds_SingleItem_DataCenter(string worldOrDc
worldOrDc);
}

[Theory(Skip = "Testing without history")]
[Theory]
[InlineData("crystaL")]
[InlineData("Crystal")]
public async Task Controller_Get_Succeeds_SingleItem_DataCenter_When_CurrentlyShownStore_Fails(string worldOrDc)
Expand Down Expand Up @@ -223,7 +223,7 @@ public async Task Controller_Get_Succeeds_SingleItem_DataCenter_When_CurrentlySh
worldOrDc);
}

[Theory(Skip = "Testing without history")]
[Theory]
[InlineData("crystaL")]
[InlineData("Crystal")]
public async Task Controller_Get_Succeeds_SingleItem_DataCenter_When_History_Fails(string worldOrDc)
Expand Down Expand Up @@ -259,7 +259,7 @@ public async Task Controller_Get_Succeeds_SingleItem_DataCenter_When_History_Fai
worldOrDc);
}

[Theory(Skip = "Testing without history")]
[Theory]
[InlineData("crystaL")]
[InlineData("Crystal")]
public async Task Controller_Get_Succeeds_MultiItem_DataCenter(string worldOrDc)
Expand Down Expand Up @@ -473,7 +473,7 @@ public async Task Controller_Get_Succeeds_MultiItem_DataCenter_WhenNotMarketable
Assert.Null(history.WorldId);
}

[Fact(Skip = "Testing without history")]
[Fact]
public async Task Controller_Get_Succeeds_SingleItem_Fields()
{
var test = TestResources.Create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static TestResources Create()
}
}

[Theory(Skip = "Testing without history")]
[Theory]
[InlineData("74")]
[InlineData("Coeurl")]
[InlineData("coEUrl")]
Expand All @@ -66,7 +66,7 @@ public async Task Controller_Get_Succeeds_SingleItem_World(string worldOrDc)
AssertCurrentlyShownValidWorld(document, sales, currentlyShown, test.GameData);
}

[Theory(Skip = "Testing without history")]
[Theory]
[InlineData("74")]
[InlineData("Coeurl")]
[InlineData("coEUrl")]
Expand Down Expand Up @@ -103,7 +103,7 @@ public async Task Controller_Get_Succeeds_MultiItem_World(string worldOrDc)
currentlyShown.Items.First(item => item.Key == document2.ItemId).Value, test.GameData);
}

[Theory(Skip = "Testing without history")]
[Theory]
[InlineData("crystaL")]
[InlineData("Crystal")]
public async Task Controller_Get_Succeeds_SingleItem_DataCenter(string worldOrDc)
Expand Down Expand Up @@ -145,7 +145,7 @@ public async Task Controller_Get_Succeeds_SingleItem_DataCenter(string worldOrDc
worldOrDc);
}

[Theory(Skip = "Testing without history")]
[Theory]
[InlineData("crystaL")]
[InlineData("Crystal")]
public async Task Controller_Get_Succeeds_MultiItem_DataCenter(string worldOrDc)
Expand Down Expand Up @@ -355,7 +355,7 @@ public async Task Controller_Get_Succeeds_MultiItem_DataCenter_WhenNotMarketable
Assert.Null(history.WorldId);
}

[Fact(Skip = "Testing without history")]
[Fact]
public async Task Controller_Get_Succeeds_SingleItem_Fields()
{
var test = TestResources.Create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,10 @@ public CurrentlyShownControllerBase(IGameDataProvider gameData, ICurrentlyShownD
var dataByItemId = data
.GroupBy(view => view.ItemId)
.Select(itemIdViews => CollateWorldViews(itemIdViews, worldDcRegion, worldIds, itemIdViews.Key, nListings,
nEntries, onlyHq, statsWithin, entriesWithin, fields));
nEntries, onlyHq, statsWithin, entriesWithin, fields))
.ToArray();

return dataByItemId.ToArray();
return dataByItemId;
}

/// <summary>
Expand Down Expand Up @@ -409,7 +410,7 @@ private async Task<IEnumerable<CurrentlyShownView>> FetchDataBatched(IEnumerable

var cs = await csTask;
var csDict = CollectListings(cs);
var history = Array.Empty<History>();
var history = await hTask;
var historyDict = CollectSales(history);

return worldItemPairs
Expand Down

0 comments on commit c2aa639

Please sign in to comment.