diff --git a/Tests/LibMatrix.Tests/Abstractions/HomeserverAbstraction.cs b/Tests/LibMatrix.Tests/Abstractions/HomeserverAbstraction.cs
index 6878b44..20be560 100644
--- a/Tests/LibMatrix.Tests/Abstractions/HomeserverAbstraction.cs
+++ b/Tests/LibMatrix.Tests/Abstractions/HomeserverAbstraction.cs
@@ -10,15 +10,15 @@ namespace LibMatrix.Tests.Abstractions;
public class HomeserverAbstraction(HomeserverProviderService _hsProvider, Config _config, ILogger<HomeserverAbstraction> _logger) {
// private static readonly HomeserverResolverService _hsResolver = new HomeserverResolverService(NullLogger<HomeserverResolverService>.Instance);
// private static readonly HomeserverProviderService _hsProvider = new HomeserverProviderService(NullLogger<HomeserverProviderService>.Instance, _hsResolver);
-
+
private static AuthenticatedHomeserverGeneric? ConfiguredHomeserver { get; set; }
private static readonly SemaphoreSlim _lock = new(1, 1);
-
+
public async Task<AuthenticatedHomeserverGeneric> GetConfiguredHomeserver(ITestOutputHelper? testOutputHelper = null) {
Assert.False(string.IsNullOrWhiteSpace(_config.TestHomeserver));
Assert.False(string.IsNullOrWhiteSpace(_config.TestUsername));
Assert.False(string.IsNullOrWhiteSpace(_config.TestPassword));
-
+
_logger.LogDebug("Using homeserver '{0}' with login '{1}' '{2}", _config.TestHomeserver, _config.TestUsername, _config.TestPassword);
testOutputHelper?.WriteLine($"Using homeserver '{_config.TestHomeserver}' with login '{_config.TestUsername}' '{_config.TestPassword}'");
@@ -29,7 +29,7 @@ public class HomeserverAbstraction(HomeserverProviderService _hsProvider, Config
}
var rhs = await _hsProvider.GetRemoteHomeserver(_config.TestHomeserver);
-
+
LoginResponse reg;
try {
reg = await rhs.LoginAsync(_config.TestUsername, _config.TestPassword);
@@ -53,27 +53,27 @@ public class HomeserverAbstraction(HomeserverProviderService _hsProvider, Config
Assert.False(string.IsNullOrWhiteSpace(_config.TestHomeserver));
var username = Guid.NewGuid().ToString();
var password = Guid.NewGuid().ToString();
-
+
_logger.LogDebug("Creating new homeserver '{0}' with login '{1}' '{2}'", _config.TestHomeserver, username, password);
-
+
var rhs = await _hsProvider.GetRemoteHomeserver(_config.TestHomeserver);
var reg = await rhs.RegisterAsync(username, password, "Unit tests!");
var hs = await _hsProvider.GetAuthenticatedWithToken(reg.Homeserver, reg.AccessToken);
-
+
return hs;
}
public async IAsyncEnumerable<AuthenticatedHomeserverGeneric> GetNewHomeservers(int count = 1) {
var createRandomUserTasks = Enumerable
.Range(0, count)
- .Select(_ => GetNewHomeserver()).ToAsyncEnumerable();
+ .Select(_ => GetNewHomeserver()).ToAsyncResultEnumerable();
await foreach (var hs in createRandomUserTasks) yield return hs;
}
public async Task<(string username, string password, string token)> GetKnownCredentials() {
Assert.False(string.IsNullOrWhiteSpace(_config.TestHomeserver));
var rhs = await _hsProvider.GetRemoteHomeserver(_config.TestHomeserver);
-
+
var username = _config.TestUsername;
var password = _config.TestPassword;
var reg = await rhs.RegisterAsync(username, password, "Unit tests!");
diff --git a/Tests/LibMatrix.Tests/Abstractions/RoomAbstraction.cs b/Tests/LibMatrix.Tests/Abstractions/RoomAbstraction.cs
index b1176ca..7c74d9f 100644
--- a/Tests/LibMatrix.Tests/Abstractions/RoomAbstraction.cs
+++ b/Tests/LibMatrix.Tests/Abstractions/RoomAbstraction.cs
@@ -14,29 +14,29 @@ public static class RoomAbstraction {
// Visibility = CreateRoomVisibility.Public,
RoomAliasName = Guid.NewGuid().ToString()
};
- crq.InitialState ??= new List<StateEvent>();
- crq.InitialState.Add(new StateEvent() {
+ crq.InitialState ??= new List<MatrixEvent>();
+ crq.InitialState.Add(new MatrixEvent() {
Type = RoomTopicEventContent.EventId,
StateKey = "",
TypedContent = new RoomTopicEventContent() {
Topic = "LibMatrix Test Room " + DateTime.Now.ToString("O")
}
});
- crq.InitialState.Add(new StateEvent() {
+ crq.InitialState.Add(new MatrixEvent() {
Type = RoomNameEventContent.EventId,
StateKey = "",
TypedContent = new RoomNameEventContent() {
Name = "LibMatrix Test Room " + DateTime.Now.ToString("O")
}
});
- crq.InitialState.Add(new StateEvent() {
+ crq.InitialState.Add(new MatrixEvent() {
Type = RoomAvatarEventContent.EventId,
StateKey = "",
TypedContent = new RoomAvatarEventContent() {
Url = "mxc://conduit.rory.gay/r9KiT0f9eQbv8pv4RxwBZFuzhfKjGWHx"
}
});
- crq.InitialState.Add(new StateEvent() {
+ crq.InitialState.Add(new MatrixEvent() {
Type = RoomAliasEventContent.EventId,
StateKey = "",
TypedContent = new RoomAliasEventContent() {
@@ -60,7 +60,7 @@ public static class RoomAbstraction {
Name = $"LibMatrix Test Space ({roomCount} children)",
// Visibility = CreateRoomVisibility.Public,
RoomAliasName = Guid.NewGuid().ToString(),
- InitialState = new List<StateEvent>()
+ InitialState = new List<MatrixEvent>()
};
crq.CreationContentBaseType.Type = "m.space";
@@ -69,10 +69,10 @@ public static class RoomAbstraction {
Name = $"LibMatrix Test Room {Guid.NewGuid()}",
// Visibility = CreateRoomVisibility.Public,
RoomAliasName = Guid.NewGuid().ToString()
- })).ToAsyncEnumerable();
+ })).ToAsyncResultEnumerable();
await foreach (var room in createRoomTasks)
- crq.InitialState.Add(new StateEvent {
+ crq.InitialState.Add(new MatrixEvent {
Type = "m.space.child",
StateKey = room.RoomId,
TypedContent = new SpaceChildEventContent() {
@@ -85,7 +85,7 @@ public static class RoomAbstraction {
if (addSpaces)
for (var i = 0; i < roomCount; i++) {
var space = await GetTestSpace(hs, roomCount - spaceSizeReduction, true, spaceSizeReduction);
- crq.InitialState.Add(new StateEvent {
+ crq.InitialState.Add(new MatrixEvent {
Type = "m.space.child",
StateKey = space.RoomId,
TypedContent = new SpaceChildEventContent() {
|