Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
<ProjectReference Include="../Behide.OnlineServices/Behide.OnlineServices.fsproj" />

<Compile Include="Common.fs" />
<Compile Include="Tests/Signaling.fs" />

<Compile Include="Tests\Types.fs" />

<Compile Include="Tests\Signaling\Common.fs" />
<Compile Include="Tests\Signaling\RoomManagement.fs" />
<Compile Include="Tests\Signaling\WebRTCSignaling.fs" />
<Compile Include="Tests\Signaling\Signaling.fs" />
<Compile Include="Program.fs" />
</ItemGroup>

Expand Down
15 changes: 5 additions & 10 deletions src/Behide.OnlineServices.Tests/Common.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,17 @@ open Behide.OnlineServices
open Behide.OnlineServices.Signaling

let createTestServer () =
let offerStore = Hubs.Signaling.ConnAttemptStore()
let connectionAttemptStore = Hubs.Signaling.ConnectionAttemptStore()
let roomStore = Hubs.Signaling.RoomStore()
let playerConnStore = Hubs.Signaling.PlayerConnStore()
let playerConnStore = Hubs.Signaling.PlayerStore()

let hostBuilder =
WebHostBuilder()
.ConfigureServices(fun services ->
services |> Program.configureServices |> ignore

services.Remove(ServiceDescriptor.Singleton<Hubs.Signaling.IConnAttemptStore, Hubs.Signaling.ConnAttemptStore>()) |> ignore
services.Remove(ServiceDescriptor.Singleton<Hubs.Signaling.IRoomStore, Hubs.Signaling.RoomStore>()) |> ignore
services.Remove(ServiceDescriptor.Singleton<Hubs.Signaling.IPlayerConnStore, Hubs.Signaling.PlayerConnStore>()) |> ignore

services.AddSingleton<Hubs.Signaling.IConnAttemptStore>(offerStore) |> ignore
services.AddSingleton<Hubs.Signaling.IConnectionAttemptStore>(connectionAttemptStore) |> ignore
services.AddSingleton<Hubs.Signaling.IRoomStore>(roomStore) |> ignore
services.AddSingleton<Hubs.Signaling.IPlayerConnStore>(playerConnStore) |> ignore
services.AddSingleton<Hubs.Signaling.IPlayerStore>(playerConnStore) |> ignore
)
.Configure(fun app ->
app.UseRouting()
Expand All @@ -36,7 +31,7 @@ let createTestServer () =
)

new TestServer(hostBuilder),
offerStore :> Store.IStore<_, _>,
connectionAttemptStore :> Store.IStore<_, _>,
roomStore :> Store.IStore<_, _>,
playerConnStore :> Store.IStore<_, _>

Expand Down
Loading