Remove nullability and transition support from star rating display

This commit is contained in:
Salman Ahmed
2021-05-14 16:01:25 +03:00
parent 34aab11ff3
commit 6cc678f497
2 changed files with 17 additions and 39 deletions

View File

@ -33,33 +33,28 @@ namespace osu.Game.Tests.Visual.Ranking
});
}
[Test]
public void TestNullStarRatingDisplay()
{
AddStep("load null", () => Child = new StarRatingDisplay
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Scale = new Vector2(3f),
});
}
[Test]
public void TestChangingStarRatingDisplay()
{
StarRatingDisplay starRating = null;
AddStep("load display", () => Child = starRating = new StarRatingDisplay
AddStep("load display", () => Child = starRating = new StarRatingDisplay(new StarDifficulty(5.55, 1))
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Scale = new Vector2(3f),
});
AddRepeatStep("change display value", () =>
AddRepeatStep("set random value", () =>
{
starRating.Current.Value = new StarDifficulty(RNG.NextDouble(0.0, 11.0), RNG.Next(2000));
starRating.Current.Value = new StarDifficulty(RNG.NextDouble(0.0, 11.0), 1);
}, 10);
AddSliderStep("set exact stars", 0.0, 11.0, 5.55, d =>
{
if (starRating != null)
starRating.Current.Value = new StarDifficulty(d, 1);
});
}
}
}