Skip to content

Commit 837a6a2

Browse files
committed
Updates the Views test of the C# regression tests
1 parent 0188ee2 commit 837a6a2

15 files changed

Lines changed: 676 additions & 653 deletions

File tree

sdks/csharp/examples~/regression-tests/client/Program.cs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void OnConnected(DbConnection conn, Identity identity, string authToken)
5050
{
5151
throw err;
5252
})
53-
.Subscribe(["SELECT * FROM ExampleData"]);
53+
.Subscribe(["SELECT * FROM ExampleData", "SELECT * FROM MyPlayer"]);
5454

5555
conn.Reducers.OnAdd += (ReducerEventContext ctx, uint id, uint indexed) =>
5656
{
@@ -134,14 +134,23 @@ void OnSubscriptionApplied(SubscriptionEventContext context)
134134
waiting--;
135135
});
136136

137+
137138
// Views test
138-
Log.Debug("Calling View");
139-
var viewRows = context.Db.GetUserByContext.Iter().FirstOrDefault();
140-
Debug.Assert(viewRows != null && viewRows.IdentityString == context.Identity?.ToString());
139+
Log.Debug("Calling Iter on View");
140+
var viewIterRows = context.Db.MyPlayer.Iter();
141+
Debug.Assert(viewIterRows != null && viewIterRows.Any());
142+
143+
Log.Debug("Calling RemoteQuery on View");
144+
var viewRemoteQueryRows = context.Db.MyPlayer.RemoteQuery("WHERE Id > 0");
145+
Debug.Assert(viewRemoteQueryRows != null && viewRemoteQueryRows.Result.Length > 0);
146+
147+
Log.Debug("Calling Iter on Anonymous View");
148+
var anonViewIterRows = context.Db.PlayersForLevel.Iter();
149+
Debug.Assert(anonViewIterRows != null && anonViewIterRows.Any());
141150

142-
Log.Debug("Calling Anonymous View");
143-
var anonViewRows = context.Db.GetUserByString.RemoteQuery("Where IdentityString = identityStringExample");
144-
Debug.Assert(anonViewRows != null && anonViewRows.Result.Length > 0);
151+
Log.Debug("Calling RemoteQuery on Anonymous View");
152+
var anonViewRemoteQueryRows = context.Db.PlayersForLevel.RemoteQuery($"WHERE Level = 1)");
153+
Debug.Assert(anonViewRemoteQueryRows != null && anonViewRemoteQueryRows.Result.Length > 0);
145154
}
146155

147156
System.AppDomain.CurrentDomain.UnhandledException += (sender, args) =>

sdks/csharp/examples~/regression-tests/client/module_bindings/Reducers/CreateNewUser.g.cs

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)