mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 20:32:55 +08:00
Add basic test to show data how one would expect it to be displayed
This commit is contained in:
parent
400984457c
commit
06389c08dc
@ -24,11 +24,18 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp() => Schedule(() => Child = sidebar = new TestNewsSidebar { YearChanged = onYearChanged });
|
public void SetUp() => Schedule(() => Child = sidebar = new TestNewsSidebar { YearChanged = onYearChanged });
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestBasic()
|
||||||
|
{
|
||||||
|
AddStep("Add metadata", () => sidebar.Metadata.Value = getMetadata(2021));
|
||||||
|
AddUntilStep("Month sections exist", () => sidebar.ChildrenOfType<MonthSection>().Any());
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestMetadataWithNoPosts()
|
public void TestMetadataWithNoPosts()
|
||||||
{
|
{
|
||||||
AddStep("Add data with no posts", () => sidebar.Metadata.Value = metadata_with_no_posts);
|
AddStep("Add data with no posts", () => sidebar.Metadata.Value = metadata_with_no_posts);
|
||||||
AddUntilStep("No dropdowns were created", () => !sidebar.ChildrenOfType<MonthSection>().Any());
|
AddUntilStep("No month sections were created", () => !sidebar.ChildrenOfType<MonthSection>().Any());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -134,7 +141,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
Metadata.BindValueChanged(m =>
|
Metadata.BindValueChanged(metadata =>
|
||||||
{
|
{
|
||||||
foreach (var b in this.ChildrenOfType<YearButton>())
|
foreach (var b in this.ChildrenOfType<YearButton>())
|
||||||
b.Action = () => YearChanged?.Invoke(b.Year);
|
b.Action = () => YearChanged?.Invoke(b.Year);
|
||||||
|
Loading…
Reference in New Issue
Block a user