diff options
author | Emma [it/its]@Rory& <root@rory.gay> | 2023-12-01 12:16:00 +0100 |
---|---|---|
committer | Emma [it/its]@Rory& <root@rory.gay> | 2023-12-01 12:16:00 +0100 |
commit | 71d115dc8e915a620dd935955ba980fcbe421dad (patch) | |
tree | b836f5b0e1b5955bbc08443f8df6d078bd0fa7ea /Tests | |
parent | Moderation bot work (diff) | |
download | LibMatrix-bak-71d115dc8e915a620dd935955ba980fcbe421dad.tar.xz |
Cleanup, move ArcaneLibs to submodule instead of parent submodule
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/LibMatrix.Tests/DataTests/WhoAmITests.cs | 2 | ||||
-rw-r--r-- | Tests/LibMatrix.Tests/GlobalUsings.cs | 2 | ||||
-rw-r--r-- | Tests/LibMatrix.Tests/Tests/RoomTests.cs | 6 | ||||
-rw-r--r-- | Tests/LibMatrix.Tests/Tests/TestCleanup.cs | 2 | ||||
-rw-r--r-- | Tests/TestDataGenerator/Program.cs | 62 |
5 files changed, 37 insertions, 37 deletions
diff --git a/Tests/LibMatrix.Tests/DataTests/WhoAmITests.cs b/Tests/LibMatrix.Tests/DataTests/WhoAmITests.cs index f737363..056cd3c 100644 --- a/Tests/LibMatrix.Tests/DataTests/WhoAmITests.cs +++ b/Tests/LibMatrix.Tests/DataTests/WhoAmITests.cs @@ -4,7 +4,7 @@ public static class WhoAmITests { public static void VerifyRequiredFields(this WhoAmIResponse obj, bool isAppservice = false) { Assert.NotNull(obj); Assert.NotNull(obj.UserId); - if(!isAppservice) + if (!isAppservice) Assert.NotNull(obj.DeviceId); } } diff --git a/Tests/LibMatrix.Tests/GlobalUsings.cs b/Tests/LibMatrix.Tests/GlobalUsings.cs index 8c927eb..c802f44 100644 --- a/Tests/LibMatrix.Tests/GlobalUsings.cs +++ b/Tests/LibMatrix.Tests/GlobalUsings.cs @@ -1 +1 @@ -global using Xunit; \ No newline at end of file +global using Xunit; diff --git a/Tests/LibMatrix.Tests/Tests/RoomTests.cs b/Tests/LibMatrix.Tests/Tests/RoomTests.cs index 65f1cca..3a11de9 100644 --- a/Tests/LibMatrix.Tests/Tests/RoomTests.cs +++ b/Tests/LibMatrix.Tests/Tests/RoomTests.cs @@ -109,7 +109,7 @@ public class RoomTests : TestBed<TestFixture> { var hs2 = await HomeserverAbstraction.GetRandomHomeserver(); var room = await RoomAbstraction.GetTestRoom(hs); Assert.NotNull(room); - await room.InviteUserAsync(hs2.UserId,"Unit test!"); + await room.InviteUserAsync(hs2.UserId, "Unit test!"); await hs2.GetRoom(room.RoomId).JoinAsync(); await room.KickAsync(hs2.UserId, "test"); var banState = await room.GetStateAsync<RoomMemberEventContent>("m.room.member", hs2.UserId); @@ -241,7 +241,7 @@ public class RoomTests : TestBed<TestFixture> { // var expectedCount = 1; var tasks = new List<Task>(); - await foreach(var otherUser in otherUsers) { + await foreach (var otherUser in otherUsers) { tasks.Add(Task.Run(async () => { await room.InviteUserAsync(otherUser.UserId); await otherUser.GetRoom(room.RoomId).JoinAsync(); @@ -251,7 +251,7 @@ public class RoomTests : TestBed<TestFixture> { var states = room.GetMembersAsync(false); var count = 0; - await foreach(var state in states) { + await foreach (var state in states) { count++; } // Assert.Equal(++expectedCount, count); diff --git a/Tests/LibMatrix.Tests/Tests/TestCleanup.cs b/Tests/LibMatrix.Tests/Tests/TestCleanup.cs index e93de3d..8fb7443 100644 --- a/Tests/LibMatrix.Tests/Tests/TestCleanup.cs +++ b/Tests/LibMatrix.Tests/Tests/TestCleanup.cs @@ -59,7 +59,7 @@ public class TestCleanup : TestBed<TestFixture> { sw.Restart(); if (response.Rooms?.Leave is { Count: > 0 }) { // foreach (var room in response.Rooms.Leave) { - // await hs.GetRoom(room.Key).ForgetAsync(); + // await hs.GetRoom(room.Key).ForgetAsync(); // } var tasks = response.Rooms.Leave.Select(async room => { await hs.GetRoom(room.Key).ForgetAsync(); diff --git a/Tests/TestDataGenerator/Program.cs b/Tests/TestDataGenerator/Program.cs index 9bd091b..18ba61e 100644 --- a/Tests/TestDataGenerator/Program.cs +++ b/Tests/TestDataGenerator/Program.cs @@ -1,31 +1,31 @@ -// See https://aka.ms/new-console-template for more information - -using System.Text.Json; -using System.Text.Json.Serialization; -using ArcaneLibs.Extensions; -using LibMatrix.Services; -using LibMatrix.Utilities.Bot; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using PluralContactBotPoC; -using PluralContactBotPoC.Bot; - -Console.WriteLine("Hello, World!"); - -var host = Host.CreateDefaultBuilder(args).ConfigureServices((_, services) => { - services.AddScoped<TieredStorageService>(x => - new TieredStorageService( - cacheStorageProvider: new FileStorageProvider("bot_data/cache/"), - dataStorageProvider: new FileStorageProvider("bot_data/data/") - ) - ); - // services.AddSingleton<DataFetcherConfiguration>(); - services.AddSingleton<AppServiceConfiguration>(); - - services.AddRoryLibMatrixServices(); - services.AddBot(withCommands: false); - - services.AddHostedService<DataFetcher>(); -}).UseConsoleLifetime().Build(); - -await host.RunAsync(); +// See https://aka.ms/new-console-template for more information + +using System.Text.Json; +using System.Text.Json.Serialization; +using ArcaneLibs.Extensions; +using LibMatrix.Services; +using LibMatrix.Utilities.Bot; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using PluralContactBotPoC; +using PluralContactBotPoC.Bot; + +Console.WriteLine("Hello, World!"); + +var host = Host.CreateDefaultBuilder(args).ConfigureServices((_, services) => { + services.AddScoped<TieredStorageService>(x => + new TieredStorageService( + cacheStorageProvider: new FileStorageProvider("bot_data/cache/"), + dataStorageProvider: new FileStorageProvider("bot_data/data/") + ) + ); + // services.AddSingleton<DataFetcherConfiguration>(); + services.AddSingleton<AppServiceConfiguration>(); + + services.AddRoryLibMatrixServices(); + services.AddBot(withCommands: false); + + services.AddHostedService<DataFetcher>(); +}).UseConsoleLifetime().Build(); + +await host.RunAsync(); |