mirror of https://github.com/ppy/osu
Refactor tests a bit
This commit is contained in:
parent
c00f9ae4b7
commit
f00967388a
|
@ -197,26 +197,34 @@ private void clickNotification<T>() where T : Notification
|
|||
|
||||
private class TestContainer : Container
|
||||
{
|
||||
private readonly Channel[] channels;
|
||||
|
||||
public TestContainer(Channel[] channels) => this.channels = channels;
|
||||
|
||||
[Cached]
|
||||
public ChannelManager ChannelManager { get; } = new ChannelManager();
|
||||
|
||||
[Cached]
|
||||
public NotificationOverlay NotificationOverlay { get; } = new NotificationOverlay();
|
||||
|
||||
[Cached]
|
||||
public MessageNotifier MessageNotifier { get; } = new MessageNotifier();
|
||||
|
||||
[Cached]
|
||||
public ChatOverlay ChatOverlay { get; } = new ChatOverlay();
|
||||
|
||||
private readonly MessageNotifier messageNotifier = new MessageNotifier();
|
||||
|
||||
private readonly Channel[] channels;
|
||||
|
||||
public TestContainer(Channel[] channels)
|
||||
{
|
||||
this.channels = channels;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
AddRange(new Drawable[] { ChannelManager, ChatOverlay, NotificationOverlay, MessageNotifier });
|
||||
Children = new Drawable[]
|
||||
{
|
||||
ChannelManager,
|
||||
ChatOverlay,
|
||||
NotificationOverlay,
|
||||
messageNotifier,
|
||||
};
|
||||
|
||||
((BindableList<Channel>)ChannelManager.AvailableChannels).AddRange(channels);
|
||||
|
||||
|
|
Loading…
Reference in New Issue