mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 19:53:23 +08:00
add test case for supporter and non supporter
This commit is contained in:
parent
93408c636b
commit
595763ae34
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
@ -95,9 +96,11 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
AddAssert(@"no stream selected", () => changelog.Header.Streams.Current.Value == null);
|
AddAssert(@"no stream selected", () => changelog.Header.Streams.Current.Value == null);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[TestCase(false)]
|
||||||
public void ShowWithBuild()
|
[TestCase(true)]
|
||||||
|
public void ShowWithBuild(bool isSupporter)
|
||||||
{
|
{
|
||||||
|
AddStep(@"set supporter", () => dummyAPI.LocalUser.Value.IsSupporter = isSupporter);
|
||||||
showBuild(() => new APIChangelogBuild
|
showBuild(() => new APIChangelogBuild
|
||||||
{
|
{
|
||||||
Version = "2018.712.0",
|
Version = "2018.712.0",
|
||||||
@ -155,6 +158,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
AddUntilStep(@"wait for streams", () => changelog.Streams?.Count > 0);
|
AddUntilStep(@"wait for streams", () => changelog.Streams?.Count > 0);
|
||||||
AddAssert(@"correct build displayed", () => changelog.Current.Value.Version == "2018.712.0");
|
AddAssert(@"correct build displayed", () => changelog.Current.Value.Version == "2018.712.0");
|
||||||
AddAssert(@"correct stream selected", () => changelog.Header.Streams.Current.Value.Id == 5);
|
AddAssert(@"correct stream selected", () => changelog.Header.Streams.Current.Value.Id == 5);
|
||||||
|
AddAssert(@"supporter promo showed", () => changelog.ChildrenOfType<ChangelogSupporterPromo>().First().Alpha == (isSupporter ? 0 : 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
Loading…
Reference in New Issue
Block a user