Refactor tests a bit

This commit is contained in:
Dean Herbert 2021-06-11 16:17:42 +09:00
parent c00f9ae4b7
commit f00967388a
1 changed files with 16 additions and 8 deletions

View File

@ -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);