mirror of
https://github.com/ppy/osu
synced 2025-01-09 07:39:46 +00:00
Add test for checking exception
This commit is contained in:
parent
b1d74e57e5
commit
5fa93f4a05
@ -186,7 +186,17 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
public void SetFacadeSizeTest()
|
||||
{
|
||||
AddStep("Add tracking containers", addFacadeContainers);
|
||||
AddStep("Break shit", () => { logoFacade.Size = new Vector2(0, 0); });
|
||||
AddStep("Break stuff", () => { logoFacade.Size = new Vector2(0, 0); });
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SetMultipleContainers()
|
||||
{
|
||||
LogoTrackingContainer newContainer = new LogoTrackingContainer();
|
||||
AddStep("Add tracking containers", addFacadeContainers);
|
||||
AddStep("Move facade to random position", startTrackingRandom);
|
||||
AddStep("Add logo to new container", () => newContainer.SetLogo(logo));
|
||||
AddStep("Break stuff", () => newContainer.Tracking = true);
|
||||
}
|
||||
|
||||
private void addFacadeContainers()
|
||||
|
@ -12,7 +12,7 @@ using osuTK;
|
||||
namespace osu.Game.Graphics.Containers
|
||||
{
|
||||
/// <summary>
|
||||
/// A container that handles tracking of an <see cref="OsuLogo"/> through different layout scenarios
|
||||
/// A container that handles tracking of an <see cref="OsuLogo"/> through different layout scenarios.
|
||||
/// </summary>
|
||||
public class LogoTrackingContainer : Container
|
||||
{
|
||||
@ -38,8 +38,6 @@ namespace osu.Game.Graphics.Containers
|
||||
}
|
||||
}
|
||||
|
||||
private bool tracking;
|
||||
|
||||
protected OsuLogo Logo;
|
||||
|
||||
private float facadeScale;
|
||||
@ -47,6 +45,7 @@ namespace osu.Game.Graphics.Containers
|
||||
private Vector2? startPosition;
|
||||
private double? startTime;
|
||||
private double duration;
|
||||
private bool tracking;
|
||||
|
||||
public LogoTrackingContainer()
|
||||
{
|
||||
@ -69,7 +68,11 @@ namespace osu.Game.Graphics.Containers
|
||||
}
|
||||
|
||||
Logo = logo ?? throw new ArgumentNullException(nameof(logo));
|
||||
Logo.IsTracking = Tracking;
|
||||
|
||||
if (Tracking)
|
||||
{
|
||||
Logo.IsTracking = true;
|
||||
}
|
||||
|
||||
this.facadeScale = facadeScale;
|
||||
this.duration = duration;
|
||||
|
Loading…
Reference in New Issue
Block a user