Example #1
0
 public void UpdateOnHigherTimestampAndScore()
 {
     DescendingIndex.UpdateUserScore(UserId: TestUserId, ScoreTimeStamp: 1100, ScoreValue: 200);
     Assert.AreEqual(
         "User(UserId:777, ScoreTimeStamp:1100, ScoreValue:200)",
         DescendingIndex.GetUserScore(UserId: TestUserId).ToString()
         );
 }
Example #2
0
 public void SameTimeStampOrdersByScoreOnDescendingIndex()
 {
     DescendingIndex.UpdateUserScore(UserId: 4, ScoreTimeStamp: 1000, ScoreValue: 40);
     DescendingIndex.UpdateUserScore(UserId: 3, ScoreTimeStamp: 1000, ScoreValue: 200);
     Assert.AreEqual(
         "3,2,4",
         String.Join(",", DescendingIndex.GetRange(StartingPosition: 0, Count: 1000).Select(Item => Item.UserId))
         );
 }
Example #3
0
 public void SameScoreAndTimeStampOrdersById()
 {
     AscendingIndex.UpdateUserScore(UserId: 0, ScoreTimeStamp: 1000, ScoreValue: 100);
     AscendingIndex.UpdateUserScore(UserId: 1, ScoreTimeStamp: 1000, ScoreValue: 100);
     Assert.AreEqual(
         "0,1,2",
         String.Join(",", AscendingIndex.GetRange(StartingPosition: 0, Count: 1000).Select(Item => Item.UserId))
         );
 }
Example #4
0
 public void Initialize()
 {
     this.ServerIndices = new ServerIndices();
     DescendingIndex    = ServerIndices["-TestIndex"];
     AscendingIndex     = ServerIndices["+TestIndex"];
     AscendingIndex.UpdateUserScore(UserId: 2, ScoreTimeStamp: 1000, ScoreValue: 100);
     DescendingIndex.UpdateUserScore(UserId: 2, ScoreTimeStamp: 1000, ScoreValue: 100);
 }
Example #5
0
 public void Initialize()
 {
     this.ServerIndices = new ServerIndices();
     DescendingIndex = ServerIndices["-TestIndex"];
     AscendingIndex = ServerIndices["+TestIndex"];
     AscendingIndex.UpdateUserScore(UserId: 2, ScoreTimeStamp: 1000, ScoreValue: 100);
     DescendingIndex.UpdateUserScore(UserId: 2, ScoreTimeStamp: 1000, ScoreValue: 100);
 }