2017-05-22 11:07:15 +08:00
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2017-05-22 12:29:39 +08:00
|
|
|
using osu.Framework.Graphics;
|
2017-05-22 11:07:15 +08:00
|
|
|
using osu.Framework.Testing;
|
2017-05-22 12:29:39 +08:00
|
|
|
using osu.Game.Screens.Multiplayer;
|
2017-05-22 11:07:15 +08:00
|
|
|
using osu.Game.Online.Multiplayer;
|
|
|
|
using osu.Game.Users;
|
|
|
|
using osu.Game.Database;
|
|
|
|
|
|
|
|
namespace osu.Desktop.VisualTests.Tests
|
|
|
|
{
|
2017-05-22 23:44:58 +08:00
|
|
|
internal class TestCaseDrawableRoom : TestCase
|
2017-05-22 11:07:15 +08:00
|
|
|
{
|
|
|
|
public override string Description => @"Select your favourite room";
|
|
|
|
|
|
|
|
public override void Reset()
|
|
|
|
{
|
|
|
|
base.Reset();
|
|
|
|
|
2017-05-23 00:05:18 +08:00
|
|
|
DrawableRoom first;
|
|
|
|
DrawableRoom second;
|
2017-05-22 11:07:15 +08:00
|
|
|
Add(new FillFlowContainer
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
Width = 500f,
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
2017-05-23 00:05:18 +08:00
|
|
|
first = new DrawableRoom(new Room()),
|
|
|
|
second = new DrawableRoom(new Room()),
|
2017-05-22 11:07:15 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2017-05-23 00:05:18 +08:00
|
|
|
first.Room.Name.Value = @"Great Room Right Here";
|
|
|
|
first.Room.Host.Value = new User { Username = @"Naeferith", Id = 9492835, Country = new Country { FlagName = @"FR" }};
|
2017-05-23 08:13:57 +08:00
|
|
|
first.Room.Status.Value = new RoomStatusOpen();
|
2017-05-30 16:12:11 +08:00
|
|
|
first.Room.Beatmap.Value = new BeatmapInfo
|
|
|
|
{
|
|
|
|
Metadata = new BeatmapMetadata
|
|
|
|
{
|
|
|
|
Title = @"Seiryu",
|
|
|
|
Artist = @"Critical Crystal",
|
|
|
|
},
|
|
|
|
};
|
2017-05-23 00:05:18 +08:00
|
|
|
|
|
|
|
second.Room.Name.Value = @"Relax It's The Weekend";
|
|
|
|
second.Room.Host.Value = new User { Username = @"peppy", Id = 2, Country = new Country { FlagName = @"AU" }};
|
2017-05-23 08:13:57 +08:00
|
|
|
second.Room.Status.Value = new RoomStatusPlaying();
|
2017-05-30 16:12:11 +08:00
|
|
|
second.Room.Beatmap.Value = new BeatmapInfo
|
|
|
|
{
|
|
|
|
Metadata = new BeatmapMetadata
|
|
|
|
{
|
|
|
|
Title = @"Serendipity",
|
|
|
|
Artist = @"ZAQ",
|
|
|
|
},
|
|
|
|
};
|
2017-05-23 00:05:18 +08:00
|
|
|
|
2017-05-22 12:01:55 +08:00
|
|
|
AddStep(@"change state", () =>
|
|
|
|
{
|
2017-05-23 08:13:57 +08:00
|
|
|
first.Room.Status.Value = new RoomStatusPlaying();
|
2017-05-22 12:01:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
AddStep(@"change name", () =>
|
|
|
|
{
|
2017-05-23 00:05:18 +08:00
|
|
|
first.Room.Name.Value = @"I Changed Name";
|
2017-05-22 12:01:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
AddStep(@"change host", () =>
|
|
|
|
{
|
2017-05-23 00:05:18 +08:00
|
|
|
first.Room.Host.Value = new User { Username = @"DrabWeb", Id = 6946022, Country = new Country { FlagName = @"CA" } };
|
2017-05-22 12:01:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
AddStep(@"change beatmap", () =>
|
|
|
|
{
|
2017-05-23 00:05:18 +08:00
|
|
|
first.Room.Beatmap.Value = null;
|
2017-05-22 12:01:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
AddStep(@"change state", () =>
|
|
|
|
{
|
2017-05-23 08:13:57 +08:00
|
|
|
first.Room.Status.Value = new RoomStatusOpen();
|
2017-05-22 12:01:55 +08:00
|
|
|
});
|
2017-05-22 11:07:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|