Set new room for each test iteration

This commit is contained in:
smoogipoo
2020-12-18 14:58:58 +09:00
parent 2969500743
commit 208a9e596e
11 changed files with 49 additions and 55 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Online.Multiplayer;
@ -10,13 +11,9 @@ namespace osu.Game.Tests.Visual
public abstract class MultiplayerTestScene : ScreenTestScene
{
[Cached]
private readonly Bindable<Room> currentRoom = new Bindable<Room>();
private readonly Bindable<Room> currentRoom = new Bindable<Room>(new Room());
protected Room Room
{
get => currentRoom.Value;
set => currentRoom.Value = value;
}
protected Room Room => currentRoom.Value;
private CachedModelDependencyContainer<Room> dependencies;
@ -26,5 +23,11 @@ namespace osu.Game.Tests.Visual
dependencies.Model.BindTo(currentRoom);
return dependencies;
}
[SetUp]
public void Setup() => Schedule(() =>
{
Room.CopyFrom(new Room());
});
}
}