2018-01-05 11:21:19 +00:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-12-25 16:12:46 +00:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2017-12-25 16:36:58 +00:00
|
|
|
|
using System.Linq;
|
2017-12-25 16:12:46 +00:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Game.Overlays.Toolbar;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual
|
|
|
|
|
{
|
|
|
|
|
public class TestCaseToolbar : OsuTestCase
|
|
|
|
|
{
|
|
|
|
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
|
|
|
|
{
|
|
|
|
|
typeof(ToolbarButton),
|
|
|
|
|
typeof(ToolbarModeSelector),
|
|
|
|
|
typeof(ToolbarModeButton),
|
2017-12-25 16:36:58 +00:00
|
|
|
|
typeof(ToolbarNotificationButton),
|
2017-12-25 16:12:46 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public TestCaseToolbar()
|
|
|
|
|
{
|
2017-12-25 16:36:58 +00:00
|
|
|
|
var toolbar = new Toolbar { State = Visibility.Visible };
|
|
|
|
|
|
|
|
|
|
Add(toolbar);
|
|
|
|
|
|
|
|
|
|
var notificationButton = toolbar.Children.OfType<FillFlowContainer>().Last().Children.OfType<ToolbarNotificationButton>().First();
|
|
|
|
|
|
|
|
|
|
void setNotifications(int count) => AddStep($"set notification count to {count}", () => notificationButton.NotificationCount.Value = count);
|
|
|
|
|
|
|
|
|
|
setNotifications(1);
|
|
|
|
|
setNotifications(2);
|
|
|
|
|
setNotifications(3);
|
|
|
|
|
setNotifications(0);
|
|
|
|
|
setNotifications(144);
|
2017-12-25 16:12:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|