Skip to content

Commit

Permalink
chore: change ranking test
Browse files Browse the repository at this point in the history
  • Loading branch information
xernobyl committed Nov 13, 2023
1 parent 49bdfc6 commit 26a566b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/ActivityTests/GetActivityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,20 @@ public async Task TestRankingVars()
Time = DateTime.Parse("2000-08-16T16:32:32"),
};

newActivity1.SetData("popularity", 123);
newActivity1.SetData("popular", 123);

var response = await this.FlatFeed.AddActivityAsync(newActivity1);
var response = await this.UserFeed.AddActivityAsync(newActivity1);

var newActivity2 = new Activity("1", "test", "2")
{
ForeignId = "r-test-2",
Time = DateTime.Parse("2000-08-17T16:32:32"),
};

response = await this.FlatFeed.AddActivityAsync(newActivity2);
response = await this.UserFeed.AddActivityAsync(newActivity2);

var ranking_vars = new Dictionary<string, object> { { "popularity", 666 } };
var r2 = await this.FlatFeed.GetFlatActivitiesAsync(GetOptions.Default.WithLimit(2).WithRanking("popularity").WithRankingVars(ranking_vars));
var r2 = await this.UserFeed.GetFlatActivitiesAsync(GetOptions.Default.WithLimit(2).WithRanking("popular").WithRankingVars(ranking_vars));
Assert.NotNull(r2);
Assert.AreEqual(2, r2.Results.Count);
Assert.AreEqual(r2.Results[0].Score, 11.090528);
Expand Down

0 comments on commit 26a566b

Please sign in to comment.