about summary refs log tree commit diff
path: root/Tests/LibMatrix.Tests/Abstractions/RoomAbstraction.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/LibMatrix.Tests/Abstractions/RoomAbstraction.cs')
-rw-r--r--Tests/LibMatrix.Tests/Abstractions/RoomAbstraction.cs34
1 files changed, 33 insertions, 1 deletions
diff --git a/Tests/LibMatrix.Tests/Abstractions/RoomAbstraction.cs b/Tests/LibMatrix.Tests/Abstractions/RoomAbstraction.cs
index 44c35da..76b8c8c 100644
--- a/Tests/LibMatrix.Tests/Abstractions/RoomAbstraction.cs
+++ b/Tests/LibMatrix.Tests/Abstractions/RoomAbstraction.cs
@@ -8,11 +8,43 @@ namespace LibMatrix.Tests.Abstractions;
 
 public static class RoomAbstraction {
     public static async Task<GenericRoom> GetTestRoom(AuthenticatedHomeserverGeneric hs) {
-        var testRoom = await hs.CreateRoom(new CreateRoomRequest() {
+        var crq = new CreateRoomRequest() {
             Name = "LibMatrix Test Room",
             // Visibility = CreateRoomVisibility.Public,
             RoomAliasName = Guid.NewGuid().ToString()
+        };
+        crq.InitialState ??= new();
+        crq.InitialState.Add(new StateEvent() {
+            Type = "m.room.topic",
+            StateKey = "",
+            TypedContent = new RoomTopicEventContent() {
+                Topic = "LibMatrix Test Room " + DateTime.Now.ToString("O")
+            }
+        });
+        crq.InitialState.Add(new StateEvent() {
+            Type = "m.room.name",
+            StateKey = "",
+            TypedContent = new RoomNameEventContent() {
+                Name = "LibMatrix Test Room " + DateTime.Now.ToString("O")
+            }
+        });
+        crq.InitialState.Add(new StateEvent() {
+            Type = "m.room.avatar",
+            StateKey = "",
+            TypedContent = new RoomAvatarEventContent() {
+                Url = "mxc://conduit.rory.gay/r9KiT0f9eQbv8pv4RxwBZFuzhfKjGWHx"
+            }
+        });
+        crq.InitialState.Add(new StateEvent() {
+            Type = "m.room.aliases",
+            StateKey = "",
+            TypedContent = new RoomAliasEventContent() {
+                Aliases = Enumerable
+                    .Range(0, 100)
+                    .Select(_ => $"#{Guid.NewGuid()}:matrixunittests.rory.gay").ToList()
+            }
         });
+        var testRoom = await hs.CreateRoom(crq);
 
         await testRoom.SendStateEventAsync("gay.rory.libmatrix.unit_test_room", new());