mirror of
https://github.com/osukey/osukey.git
synced 2025-08-01 21:58:46 +09:00
Merge branch 'master' into beatmap-card/download-button
This commit is contained in:
@ -13,10 +13,17 @@ namespace osu.Game.Tests.Visual.Components
|
||||
{
|
||||
public class TestScenePreviewTrackManager : OsuTestScene, IPreviewTrackOwner
|
||||
{
|
||||
private readonly TestPreviewTrackManager trackManager = new TestPreviewTrackManager();
|
||||
private readonly IAdjustableAudioComponent gameTrackAudio = new AudioAdjustments();
|
||||
|
||||
private readonly TestPreviewTrackManager trackManager;
|
||||
|
||||
private AudioManager audio;
|
||||
|
||||
public TestScenePreviewTrackManager()
|
||||
{
|
||||
trackManager = new TestPreviewTrackManager(gameTrackAudio);
|
||||
}
|
||||
|
||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||
{
|
||||
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||
@ -151,19 +158,19 @@ namespace osu.Game.Tests.Visual.Components
|
||||
audio.VolumeTrack.Value = 1;
|
||||
});
|
||||
|
||||
AddAssert("game not muted", () => audio.Tracks.AggregateVolume.Value != 0);
|
||||
AddAssert("game not muted", () => gameTrackAudio.AggregateVolume.Value != 0);
|
||||
|
||||
AddStep("get track", () => Add(owner = new TestTrackOwner(track = getTrack())));
|
||||
AddUntilStep("wait loaded", () => track.IsLoaded);
|
||||
AddStep("start track", () => track.Start());
|
||||
AddAssert("game is muted", () => audio.Tracks.AggregateVolume.Value == 0);
|
||||
AddAssert("game is muted", () => gameTrackAudio.AggregateVolume.Value == 0);
|
||||
|
||||
if (stopAnyPlaying)
|
||||
AddStep("stop any playing", () => trackManager.StopAnyPlaying(owner));
|
||||
else
|
||||
AddStep("stop track", () => track.Stop());
|
||||
|
||||
AddAssert("game not muted", () => audio.Tracks.AggregateVolume.Value != 0);
|
||||
AddAssert("game not muted", () => gameTrackAudio.AggregateVolume.Value != 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -224,6 +231,11 @@ namespace osu.Game.Tests.Visual.Components
|
||||
|
||||
public new PreviewTrack CurrentTrack => base.CurrentTrack;
|
||||
|
||||
public TestPreviewTrackManager(IAdjustableAudioComponent mainTrackAdjustments)
|
||||
: base(mainTrackAdjustments)
|
||||
{
|
||||
}
|
||||
|
||||
protected override TrackManagerPreviewTrack CreatePreviewTrack(IBeatmapSetInfo beatmapSetInfo, ITrackStore trackStore) => new TestPreviewTrack(beatmapSetInfo, trackStore);
|
||||
|
||||
public override bool UpdateSubTree()
|
||||
|
@ -26,6 +26,9 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
}
|
||||
});
|
||||
|
||||
[Cached]
|
||||
private EditorClipboard clipboard = new EditorClipboard();
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
editorBeatmap.BeatmapInfo.Metadata.Artist = "artist";
|
||||
editorBeatmap.BeatmapInfo.Metadata.Title = "title";
|
||||
});
|
||||
AddStep("Set difficulty name", () => editorBeatmap.BeatmapInfo.Version = "difficulty");
|
||||
AddStep("Set difficulty name", () => editorBeatmap.BeatmapInfo.DifficultyName = "difficulty");
|
||||
|
||||
AddStep("Add timing point", () => editorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint()));
|
||||
|
||||
@ -85,7 +85,7 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
AddAssert("Beatmap contains single hitcircle", () => editorBeatmap.HitObjects.Count == 1);
|
||||
AddAssert("Beatmap has correct overall difficulty", () => editorBeatmap.Difficulty.OverallDifficulty == 7);
|
||||
AddAssert("Beatmap has correct metadata", () => editorBeatmap.BeatmapInfo.Metadata.Artist == "artist" && editorBeatmap.BeatmapInfo.Metadata.Title == "title");
|
||||
AddAssert("Beatmap has correct difficulty name", () => editorBeatmap.BeatmapInfo.Version == "difficulty");
|
||||
AddAssert("Beatmap has correct difficulty name", () => editorBeatmap.BeatmapInfo.DifficultyName == "difficulty");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
123
osu.Game.Tests/Visual/Editing/TestSceneEditorTestGameplay.cs
Normal file
123
osu.Game.Tests/Visual/Editing/TestSceneEditorTestGameplay.cs
Normal file
@ -0,0 +1,123 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Screens.Edit;
|
||||
using osu.Game.Screens.Edit.Components.Timelines.Summary;
|
||||
using osu.Game.Tests.Beatmaps.IO;
|
||||
using osuTK.Input;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Editing
|
||||
{
|
||||
public class TestSceneEditorTestGameplay : EditorTestScene
|
||||
{
|
||||
protected override bool IsolateSavingFromDatabase => false;
|
||||
|
||||
protected override Ruleset CreateEditorRuleset() => new OsuRuleset();
|
||||
|
||||
[Resolved]
|
||||
private OsuGameBase game { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private BeatmapManager beatmaps { get; set; }
|
||||
|
||||
private BeatmapSetInfo importedBeatmapSet;
|
||||
|
||||
public override void SetUpSteps()
|
||||
{
|
||||
AddStep("import test beatmap", () => importedBeatmapSet = ImportBeatmapTest.LoadOszIntoOsu(game).Result);
|
||||
base.SetUpSteps();
|
||||
}
|
||||
|
||||
protected override void LoadEditor()
|
||||
{
|
||||
Beatmap.Value = beatmaps.GetWorkingBeatmap(importedBeatmapSet.Beatmaps.First(b => b.RulesetID == 0));
|
||||
base.LoadEditor();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestBasicGameplayTest()
|
||||
{
|
||||
AddStep("click test gameplay button", () =>
|
||||
{
|
||||
var button = Editor.ChildrenOfType<TestGameplayButton>().Single();
|
||||
|
||||
InputManager.MoveMouseTo(button);
|
||||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
|
||||
EditorPlayer editorPlayer = null;
|
||||
AddUntilStep("player pushed", () => (editorPlayer = Stack.CurrentScreen as EditorPlayer) != null);
|
||||
AddStep("exit player", () => editorPlayer.Exit());
|
||||
AddUntilStep("current screen is editor", () => Stack.CurrentScreen is Editor);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCancelGameplayTestWithUnsavedChanges()
|
||||
{
|
||||
AddStep("delete all but first object", () => EditorBeatmap.RemoveRange(EditorBeatmap.HitObjects.Skip(1).ToList()));
|
||||
|
||||
AddStep("click test gameplay button", () =>
|
||||
{
|
||||
var button = Editor.ChildrenOfType<TestGameplayButton>().Single();
|
||||
|
||||
InputManager.MoveMouseTo(button);
|
||||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
AddUntilStep("save prompt shown", () => DialogOverlay.CurrentDialog is SaveBeforeGameplayTestDialog);
|
||||
|
||||
AddStep("dismiss prompt", () =>
|
||||
{
|
||||
var button = DialogOverlay.CurrentDialog.Buttons.Last();
|
||||
InputManager.MoveMouseTo(button);
|
||||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
|
||||
AddWaitStep("wait some", 3);
|
||||
AddAssert("stayed in editor", () => Stack.CurrentScreen is Editor);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSaveChangesBeforeGameplayTest()
|
||||
{
|
||||
AddStep("delete all but first object", () => EditorBeatmap.RemoveRange(EditorBeatmap.HitObjects.Skip(1).ToList()));
|
||||
// bit of a hack to ensure this test can be ran multiple times without running into UNIQUE constraint failures
|
||||
AddStep("set unique difficulty name", () => EditorBeatmap.BeatmapInfo.DifficultyName = Guid.NewGuid().ToString());
|
||||
|
||||
AddStep("click test gameplay button", () =>
|
||||
{
|
||||
var button = Editor.ChildrenOfType<TestGameplayButton>().Single();
|
||||
|
||||
InputManager.MoveMouseTo(button);
|
||||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
AddUntilStep("save prompt shown", () => DialogOverlay.CurrentDialog is SaveBeforeGameplayTestDialog);
|
||||
|
||||
AddStep("save changes", () => DialogOverlay.CurrentDialog.PerformOkAction());
|
||||
|
||||
EditorPlayer editorPlayer = null;
|
||||
AddUntilStep("player pushed", () => (editorPlayer = Stack.CurrentScreen as EditorPlayer) != null);
|
||||
AddAssert("beatmap has 1 object", () => editorPlayer.Beatmap.Value.Beatmap.HitObjects.Count == 1);
|
||||
|
||||
AddUntilStep("wait for return to editor", () => Stack.CurrentScreen is Editor);
|
||||
AddAssert("track stopped", () => !Beatmap.Value.Track.IsRunning);
|
||||
}
|
||||
|
||||
public override void TearDownSteps()
|
||||
{
|
||||
base.TearDownSteps();
|
||||
AddStep("delete imported", () =>
|
||||
{
|
||||
beatmaps.Delete(importedBeatmapSet);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Catch;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
@ -23,6 +24,9 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
[Cached(typeof(IBeatSnapProvider))]
|
||||
private readonly EditorBeatmap editorBeatmap;
|
||||
|
||||
[Cached]
|
||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
||||
|
||||
public TestSceneSetupScreen()
|
||||
{
|
||||
editorBeatmap = new EditorBeatmap(new OsuBeatmap());
|
||||
|
@ -4,6 +4,7 @@
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Screens.Edit;
|
||||
@ -18,6 +19,9 @@ namespace osu.Game.Tests.Visual.Editing
|
||||
[Cached(typeof(IBeatSnapProvider))]
|
||||
private readonly EditorBeatmap editorBeatmap;
|
||||
|
||||
[Cached]
|
||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
||||
|
||||
protected override bool ScrollUsingMouseWheel => false;
|
||||
|
||||
public TestSceneTimingScreen()
|
||||
|
@ -1,9 +1,10 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Rulesets;
|
||||
@ -20,16 +21,17 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
public class TestScenePerformancePointsCounter : OsuTestScene
|
||||
{
|
||||
[Cached]
|
||||
private GameplayState gameplayState;
|
||||
private DependencyProvidingContainer dependencyContainer;
|
||||
|
||||
[Cached]
|
||||
private GameplayState gameplayState;
|
||||
private ScoreProcessor scoreProcessor;
|
||||
|
||||
private int iteration;
|
||||
private Bindable<JudgementResult> lastJudgementResult = new Bindable<JudgementResult>();
|
||||
private PerformancePointsCounter counter;
|
||||
|
||||
public TestScenePerformancePointsCounter()
|
||||
[SetUpSteps]
|
||||
public void SetUpSteps() => AddStep("create components", () =>
|
||||
{
|
||||
var ruleset = CreateRuleset();
|
||||
|
||||
@ -38,32 +40,43 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
var beatmap = CreateWorkingBeatmap(ruleset.RulesetInfo)
|
||||
.GetPlayableBeatmap(ruleset.RulesetInfo);
|
||||
|
||||
lastJudgementResult = new Bindable<JudgementResult>();
|
||||
|
||||
gameplayState = new GameplayState(beatmap, ruleset);
|
||||
gameplayState.LastJudgementResult.BindTo(lastJudgementResult);
|
||||
|
||||
scoreProcessor = new ScoreProcessor();
|
||||
}
|
||||
|
||||
Child = dependencyContainer = new DependencyProvidingContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
CachedDependencies = new (Type, object)[]
|
||||
{
|
||||
(typeof(GameplayState), gameplayState),
|
||||
(typeof(ScoreProcessor), scoreProcessor)
|
||||
}
|
||||
};
|
||||
|
||||
iteration = 0;
|
||||
});
|
||||
|
||||
protected override Ruleset CreateRuleset() => new OsuRuleset();
|
||||
|
||||
[SetUpSteps]
|
||||
public void SetUpSteps()
|
||||
private void createCounter() => AddStep("Create counter", () =>
|
||||
{
|
||||
AddStep("Create counter", () =>
|
||||
dependencyContainer.Child = counter = new PerformancePointsCounter
|
||||
{
|
||||
iteration = 0;
|
||||
|
||||
Child = counter = new PerformancePointsCounter
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Scale = new Vector2(5),
|
||||
};
|
||||
});
|
||||
}
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Scale = new Vector2(5),
|
||||
};
|
||||
});
|
||||
|
||||
[Test]
|
||||
public void TestBasicCounting()
|
||||
{
|
||||
int previousValue = 0;
|
||||
createCounter();
|
||||
|
||||
AddAssert("counter displaying zero", () => counter.Current.Value == 0);
|
||||
|
||||
@ -86,6 +99,17 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AddUntilStep("counter non-zero", () => counter.Current.Value > 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCounterUpdatesWithJudgementsBeforeCreation()
|
||||
{
|
||||
AddRepeatStep("Add judgement", applyOneJudgement, 10);
|
||||
|
||||
createCounter();
|
||||
|
||||
AddUntilStep("counter non-zero", () => counter.Current.Value > 0);
|
||||
AddUntilStep("counter opaque", () => counter.Child.Alpha == 1);
|
||||
}
|
||||
|
||||
private void applyOneJudgement()
|
||||
{
|
||||
var scoreInfo = gameplayState.Score.ScoreInfo;
|
||||
@ -94,13 +118,14 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
scoreInfo.Accuracy = 1;
|
||||
scoreInfo.Statistics[HitResult.Great] = iteration * 1000;
|
||||
|
||||
scoreProcessor.ApplyResult(new OsuJudgementResult(new HitObject
|
||||
lastJudgementResult.Value = new OsuJudgementResult(new HitObject
|
||||
{
|
||||
StartTime = iteration * 10000,
|
||||
}, new OsuJudgement())
|
||||
{
|
||||
Type = HitResult.Perfect,
|
||||
});
|
||||
};
|
||||
scoreProcessor.ApplyResult(lastJudgementResult.Value);
|
||||
|
||||
iteration++;
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
createPlayerTest(false, r =>
|
||||
{
|
||||
var beatmap = createTestBeatmap(r);
|
||||
beatmap.BeatmapInfo.OnlineBeatmapID = null;
|
||||
beatmap.BeatmapInfo.OnlineID = null;
|
||||
return beatmap;
|
||||
});
|
||||
|
||||
|
@ -175,7 +175,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
Id = 39828,
|
||||
Username = @"WubWoofWolf",
|
||||
}
|
||||
}.CreateScoreInfo(rulesets);
|
||||
}.CreateScoreInfo(rulesets, CreateBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo);
|
||||
}
|
||||
|
||||
private class TestReplayDownloadButton : ReplayDownloadButton
|
||||
|
@ -61,7 +61,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
AddStep("import beatmap", () =>
|
||||
{
|
||||
importedBeatmap = ImportBeatmapTest.LoadOszIntoOsu(game, virtualTrack: true).Result;
|
||||
importedBeatmapId = importedBeatmap.Beatmaps.First(b => b.RulesetID == 0).OnlineBeatmapID ?? -1;
|
||||
importedBeatmapId = importedBeatmap.Beatmaps.First(b => b.RulesetID == 0).OnlineID ?? -1;
|
||||
});
|
||||
}
|
||||
|
||||
|
108
osu.Game.Tests/Visual/Gameplay/TestSceneUnstableRateCounter.cs
Normal file
108
osu.Game.Tests/Visual/Gameplay/TestSceneUnstableRateCounter.cs
Normal file
@ -0,0 +1,108 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Rulesets.Judgements;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Rulesets.Osu.Scoring;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
public class TestSceneUnstableRateCounter : OsuTestScene
|
||||
{
|
||||
[Cached(typeof(ScoreProcessor))]
|
||||
private TestScoreProcessor scoreProcessor = new TestScoreProcessor();
|
||||
|
||||
private readonly OsuHitWindows hitWindows = new OsuHitWindows();
|
||||
|
||||
private UnstableRateCounter counter;
|
||||
|
||||
private double prev;
|
||||
|
||||
[SetUpSteps]
|
||||
public void SetUp()
|
||||
{
|
||||
AddStep("Reset Score Processor", () => scoreProcessor.Reset());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestBasic()
|
||||
{
|
||||
AddStep("Create Display", recreateDisplay);
|
||||
|
||||
// Needs multiples 2 by the nature of UR, and went for 4 to be safe.
|
||||
// Creates a 250 UR by placing a +25ms then a -25ms judgement, which then results in a 250 UR
|
||||
AddRepeatStep("Set UR to 250", () => applyJudgement(25, true), 4);
|
||||
|
||||
AddUntilStep("UR = 250", () => counter.Current.Value == 250.0);
|
||||
|
||||
AddRepeatStep("Revert UR", () =>
|
||||
{
|
||||
scoreProcessor.RevertResult(
|
||||
new JudgementResult(new HitCircle { HitWindows = hitWindows }, new Judgement())
|
||||
{
|
||||
TimeOffset = 25,
|
||||
Type = HitResult.Perfect,
|
||||
});
|
||||
}, 4);
|
||||
|
||||
AddUntilStep("UR is 0", () => counter.Current.Value == 0.0);
|
||||
AddUntilStep("Counter is invalid", () => counter.Child.Alpha == 0.3f);
|
||||
|
||||
//Sets a UR of 0 by creating 10 10ms offset judgements. Since average = offset, UR = 0
|
||||
AddRepeatStep("Set UR to 0", () => applyJudgement(10, false), 10);
|
||||
//Applies a UR of 100 by creating 10 -10ms offset judgements. At the 10th judgement, offset should be 100.
|
||||
AddRepeatStep("Bring UR to 100", () => applyJudgement(-10, false), 10);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCounterReceivesJudgementsBeforeCreation()
|
||||
{
|
||||
AddRepeatStep("Set UR to 250", () => applyJudgement(25, true), 4);
|
||||
|
||||
AddStep("Create Display", recreateDisplay);
|
||||
|
||||
AddUntilStep("UR = 250", () => counter.Current.Value == 250.0);
|
||||
}
|
||||
|
||||
private void recreateDisplay()
|
||||
{
|
||||
Clear();
|
||||
|
||||
Add(counter = new UnstableRateCounter
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Scale = new Vector2(5),
|
||||
});
|
||||
}
|
||||
|
||||
private void applyJudgement(double offsetMs, bool alt)
|
||||
{
|
||||
double placement = offsetMs;
|
||||
|
||||
if (alt)
|
||||
{
|
||||
placement = prev > 0 ? -offsetMs : offsetMs;
|
||||
prev = placement;
|
||||
}
|
||||
|
||||
scoreProcessor.ApplyResult(new JudgementResult(new HitCircle { HitWindows = hitWindows }, new Judgement())
|
||||
{
|
||||
TimeOffset = placement,
|
||||
Type = HitResult.Perfect,
|
||||
});
|
||||
}
|
||||
|
||||
private class TestScoreProcessor : ScoreProcessor
|
||||
{
|
||||
public void Reset() => base.Reset(false);
|
||||
}
|
||||
}
|
||||
}
|
@ -59,7 +59,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
BeatmapInfo =
|
||||
{
|
||||
StarDifficulty = 2.5
|
||||
StarRating = 2.5
|
||||
}
|
||||
}.BeatmapInfo,
|
||||
}
|
||||
@ -82,7 +82,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
BeatmapInfo =
|
||||
{
|
||||
StarDifficulty = 2.5,
|
||||
StarRating = 2.5,
|
||||
Metadata =
|
||||
{
|
||||
Artist = "very very very very very very very very very long artist",
|
||||
@ -111,7 +111,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
BeatmapInfo =
|
||||
{
|
||||
StarDifficulty = 2.5
|
||||
StarRating = 2.5
|
||||
}
|
||||
}.BeatmapInfo,
|
||||
}
|
||||
@ -124,7 +124,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
BeatmapInfo =
|
||||
{
|
||||
StarDifficulty = 4.5
|
||||
StarRating = 4.5
|
||||
}
|
||||
}.BeatmapInfo,
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
importedSet = ImportBeatmapTest.LoadOszIntoOsu(game, virtualTrack: true).Result;
|
||||
importedBeatmap = importedSet.Beatmaps.First(b => b.RulesetID == 0);
|
||||
importedBeatmapId = importedBeatmap.OnlineBeatmapID ?? -1;
|
||||
importedBeatmapId = importedBeatmap.OnlineID ?? -1;
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
|
@ -57,7 +57,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
foreach (int user in users)
|
||||
{
|
||||
SpectatorClient.StartPlay(user, Beatmap.Value.BeatmapInfo.OnlineBeatmapID ?? 0);
|
||||
SpectatorClient.StartPlay(user, Beatmap.Value.BeatmapInfo.OnlineID ?? 0);
|
||||
multiplayerUsers.Add(OnlinePlayDependencies.Client.AddUser(new APIUser { Id = user }, true));
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
foreach (int user in users)
|
||||
{
|
||||
SpectatorClient.StartPlay(user, Beatmap.Value.BeatmapInfo.OnlineBeatmapID ?? 0);
|
||||
SpectatorClient.StartPlay(user, Beatmap.Value.BeatmapInfo.OnlineID ?? 0);
|
||||
var roomUser = OnlinePlayDependencies.Client.AddUser(new APIUser { Id = user }, true);
|
||||
|
||||
roomUser.MatchState = new TeamVersusUserState
|
||||
|
@ -57,7 +57,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
beatmaps.Add(new BeatmapInfo
|
||||
{
|
||||
Ruleset = rulesets.GetRuleset(i % 4),
|
||||
OnlineBeatmapID = beatmapId,
|
||||
OnlineID = beatmapId,
|
||||
Length = length,
|
||||
BPM = bpm,
|
||||
BaseDifficulty = new BeatmapDifficulty()
|
||||
@ -66,7 +66,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
manager.Import(new BeatmapSetInfo
|
||||
{
|
||||
OnlineBeatmapSetID = 10,
|
||||
OnlineID = 10,
|
||||
Hash = Guid.NewGuid().ToString().ComputeMD5Hash(),
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
|
@ -54,8 +54,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
beatmaps.Add(new BeatmapInfo
|
||||
{
|
||||
Ruleset = new OsuRuleset().RulesetInfo,
|
||||
OnlineBeatmapID = beatmapId,
|
||||
Version = $"{beatmapId} (length {TimeSpan.FromMilliseconds(length):m\\:ss}, bpm {bpm:0.#})",
|
||||
OnlineID = beatmapId,
|
||||
DifficultyName = $"{beatmapId} (length {TimeSpan.FromMilliseconds(length):m\\:ss}, bpm {bpm:0.#})",
|
||||
Length = length,
|
||||
BPM = bpm,
|
||||
BaseDifficulty = new BeatmapDifficulty
|
||||
@ -67,7 +67,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
manager.Import(new BeatmapSetInfo
|
||||
{
|
||||
OnlineBeatmapSetID = 10,
|
||||
OnlineID = 10,
|
||||
Hash = new MemoryStream(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())).ComputeMD5Hash(),
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
|
@ -31,8 +31,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
SelectedRoom.Value.Playlist.AddRange(new[]
|
||||
{
|
||||
new PlaylistItem { Beatmap = { Value = new BeatmapInfo { StarDifficulty = min } } },
|
||||
new PlaylistItem { Beatmap = { Value = new BeatmapInfo { StarDifficulty = max } } },
|
||||
new PlaylistItem { Beatmap = { Value = new BeatmapInfo { StarRating = min } } },
|
||||
new PlaylistItem { Beatmap = { Value = new BeatmapInfo { StarRating = max } } },
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ using osu.Framework.Platform;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
|
||||
using osu.Game.Online.Rooms;
|
||||
using osu.Game.Rulesets;
|
||||
@ -97,16 +98,24 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
});
|
||||
|
||||
AddAssert("user on team 0", () => (client.Room?.Users.FirstOrDefault()?.MatchState as TeamVersusUserState)?.TeamID == 0);
|
||||
AddStep("add another user", () => client.AddUser(new APIUser { Username = "otheruser", Id = 44 }));
|
||||
|
||||
AddStep("press button", () =>
|
||||
AddStep("press own button", () =>
|
||||
{
|
||||
InputManager.MoveMouseTo(multiplayerScreenStack.ChildrenOfType<TeamDisplay>().First());
|
||||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
AddAssert("user on team 1", () => (client.Room?.Users.FirstOrDefault()?.MatchState as TeamVersusUserState)?.TeamID == 1);
|
||||
|
||||
AddStep("press button", () => InputManager.Click(MouseButton.Left));
|
||||
AddStep("press own button again", () => InputManager.Click(MouseButton.Left));
|
||||
AddAssert("user on team 0", () => (client.Room?.Users.FirstOrDefault()?.MatchState as TeamVersusUserState)?.TeamID == 0);
|
||||
|
||||
AddStep("press other user's button", () =>
|
||||
{
|
||||
InputManager.MoveMouseTo(multiplayerScreenStack.ChildrenOfType<TeamDisplay>().ElementAt(1));
|
||||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
AddAssert("user still on team 0", () => (client.Room?.Users.FirstOrDefault()?.MatchState as TeamVersusUserState)?.TeamID == 0);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -127,9 +136,13 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
AddAssert("room type is head to head", () => client.Room?.Settings.MatchType == MatchType.HeadToHead);
|
||||
|
||||
AddUntilStep("team displays are not displaying teams", () => multiplayerScreenStack.ChildrenOfType<TeamDisplay>().All(d => d.DisplayedTeam == null));
|
||||
|
||||
AddStep("change to team vs", () => client.ChangeSettings(matchType: MatchType.TeamVersus));
|
||||
|
||||
AddAssert("room type is team vs", () => client.Room?.Settings.MatchType == MatchType.TeamVersus);
|
||||
|
||||
AddUntilStep("team displays are displaying teams", () => multiplayerScreenStack.ChildrenOfType<TeamDisplay>().All(d => d.DisplayedTeam != null));
|
||||
}
|
||||
|
||||
private void createRoom(Func<Room> room)
|
||||
|
@ -174,7 +174,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
{
|
||||
AddStep("import beatmap", () => ImportBeatmapTest.LoadQuickOszIntoOsu(Game).Wait());
|
||||
PushAndConfirm(() => new TestPlaySongSelect());
|
||||
AddUntilStep("beatmap updated", () => Game.Beatmap.Value.BeatmapSetInfo.OnlineBeatmapSetID == 241526);
|
||||
AddUntilStep("beatmap updated", () => Game.Beatmap.Value.BeatmapSetInfo.OnlineID == 241526);
|
||||
}
|
||||
|
||||
public class DialogBlockingScreen : OsuScreen
|
||||
|
@ -107,20 +107,20 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
imported = Game.BeatmapManager.Import(new BeatmapSetInfo
|
||||
{
|
||||
Hash = Guid.NewGuid().ToString(),
|
||||
OnlineBeatmapSetID = i,
|
||||
OnlineID = i,
|
||||
Metadata = metadata,
|
||||
Beatmaps = new List<BeatmapInfo>
|
||||
{
|
||||
new BeatmapInfo
|
||||
{
|
||||
OnlineBeatmapID = i * 1024,
|
||||
OnlineID = i * 1024,
|
||||
Metadata = metadata,
|
||||
BaseDifficulty = difficulty,
|
||||
Ruleset = ruleset ?? new OsuRuleset().RulesetInfo
|
||||
},
|
||||
new BeatmapInfo
|
||||
{
|
||||
OnlineBeatmapID = i * 2048,
|
||||
OnlineID = i * 2048,
|
||||
Metadata = metadata,
|
||||
BaseDifficulty = difficulty,
|
||||
Ruleset = ruleset ?? new OsuRuleset().RulesetInfo
|
||||
@ -145,11 +145,11 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
|
||||
private void presentSecondDifficultyAndConfirm(Func<BeatmapSetInfo> getImport, int importedID)
|
||||
{
|
||||
Predicate<BeatmapInfo> pred = b => b.OnlineBeatmapID == importedID * 2048;
|
||||
Predicate<BeatmapInfo> pred = b => b.OnlineID == importedID * 2048;
|
||||
AddStep("present difficulty", () => Game.PresentBeatmap(getImport(), pred));
|
||||
|
||||
AddUntilStep("wait for song select", () => Game.ScreenStack.CurrentScreen is Screens.Select.SongSelect);
|
||||
AddUntilStep("correct beatmap displayed", () => Game.Beatmap.Value.BeatmapInfo.OnlineBeatmapID == importedID * 2048);
|
||||
AddUntilStep("correct beatmap displayed", () => Game.Beatmap.Value.BeatmapInfo.OnlineID == importedID * 2048);
|
||||
AddAssert("correct ruleset selected", () => Game.Ruleset.Value.ID == getImport().Beatmaps.First().Ruleset.ID);
|
||||
}
|
||||
}
|
||||
|
@ -39,20 +39,20 @@ namespace osu.Game.Tests.Visual.Navigation
|
||||
beatmap = Game.BeatmapManager.Import(new BeatmapSetInfo
|
||||
{
|
||||
Hash = Guid.NewGuid().ToString(),
|
||||
OnlineBeatmapSetID = 1,
|
||||
OnlineID = 1,
|
||||
Metadata = metadata,
|
||||
Beatmaps = new List<BeatmapInfo>
|
||||
{
|
||||
new BeatmapInfo
|
||||
{
|
||||
OnlineBeatmapID = 1 * 1024,
|
||||
OnlineID = 1 * 1024,
|
||||
Metadata = metadata,
|
||||
BaseDifficulty = difficulty,
|
||||
Ruleset = new OsuRuleset().RulesetInfo
|
||||
},
|
||||
new BeatmapInfo
|
||||
{
|
||||
OnlineBeatmapID = 1 * 2048,
|
||||
OnlineID = 1 * 2048,
|
||||
Metadata = metadata,
|
||||
BaseDifficulty = difficulty,
|
||||
Ruleset = new OsuRuleset().RulesetInfo
|
||||
|
@ -44,7 +44,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
AddAssert("button state not downloaded", () => downloadButton.DownloadState == DownloadState.NotDownloaded);
|
||||
AddStep("import soleily", () => beatmaps.Import(TestResources.GetQuickTestBeatmapForImport()));
|
||||
|
||||
AddUntilStep("wait for beatmap import", () => beatmaps.GetAllUsableBeatmapSets().Any(b => b.OnlineBeatmapSetID == 241526));
|
||||
AddUntilStep("wait for beatmap import", () => beatmaps.GetAllUsableBeatmapSets().Any(b => b.OnlineID == 241526));
|
||||
AddUntilStep("button state downloaded", () => downloadButton.DownloadState == DownloadState.LocallyAvailable);
|
||||
|
||||
createButtonWithBeatmap(createSoleily());
|
||||
@ -57,7 +57,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
AddStep("remove soleily", () =>
|
||||
{
|
||||
var beatmap = beatmaps.QueryBeatmapSet(b => b.OnlineBeatmapSetID == 241526);
|
||||
var beatmap = beatmaps.QueryBeatmapSet(b => b.OnlineID == 241526);
|
||||
|
||||
if (beatmap != null) beatmaps.Delete(beatmap);
|
||||
});
|
||||
|
@ -64,7 +64,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
|
||||
AddStep("Set beatmap", () => Beatmap.Value = new DummyWorkingBeatmap(Audio, null)
|
||||
{
|
||||
BeatmapInfo = { OnlineBeatmapID = hasOnlineId ? 1234 : (int?)null }
|
||||
BeatmapInfo = { OnlineID = hasOnlineId ? 1234 : (int?)null }
|
||||
});
|
||||
|
||||
AddStep("Run command", () => Add(new NowPlayingCommand()));
|
||||
|
@ -121,8 +121,8 @@ namespace osu.Game.Tests.Visual.Playlists
|
||||
beatmap.BeatmapInfo.BaseDifficulty.CircleSize = 1;
|
||||
|
||||
// intentionally increment online IDs to clash with import below.
|
||||
beatmap.BeatmapInfo.OnlineBeatmapID++;
|
||||
beatmap.BeatmapInfo.BeatmapSet.OnlineBeatmapSetID++;
|
||||
beatmap.BeatmapInfo.OnlineID++;
|
||||
beatmap.BeatmapInfo.BeatmapSet.OnlineID++;
|
||||
|
||||
importedSet = manager.Import(beatmap.BeatmapInfo.BeatmapSet).Result.Value;
|
||||
});
|
||||
|
@ -337,7 +337,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
public UnrankedSoloResultsScreen(ScoreInfo score)
|
||||
: base(score, true)
|
||||
{
|
||||
Score.BeatmapInfo.OnlineBeatmapID = 0;
|
||||
Score.BeatmapInfo.OnlineID = 0;
|
||||
Score.BeatmapInfo.Status = BeatmapSetOnlineStatus.Pending;
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
OverallDifficulty = 5.7f,
|
||||
ApproachRate = 3.5f
|
||||
},
|
||||
StarDifficulty = 4.5f
|
||||
StarRating = 4.5f
|
||||
};
|
||||
|
||||
[Test]
|
||||
@ -76,7 +76,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
OverallDifficulty = 4.5f,
|
||||
ApproachRate = 3.1f
|
||||
},
|
||||
StarDifficulty = 8
|
||||
StarRating = 8
|
||||
});
|
||||
|
||||
AddAssert("first bar text is Key Count", () => advancedStats.ChildrenOfType<SpriteText>().First().Text == "Key Count");
|
||||
|
@ -435,8 +435,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
var set = createTestBeatmapSet(i);
|
||||
set.Beatmaps[0].StarDifficulty = 3 - i;
|
||||
set.Beatmaps[2].StarDifficulty = 6 + i;
|
||||
set.Beatmaps[0].StarRating = 3 - i;
|
||||
set.Beatmaps[2].StarRating = 6 + i;
|
||||
sets.Add(set);
|
||||
}
|
||||
|
||||
@ -684,9 +684,9 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
{
|
||||
set.Beatmaps.Add(new BeatmapInfo
|
||||
{
|
||||
Version = $"Stars: {i}",
|
||||
DifficultyName = $"Stars: {i}",
|
||||
Ruleset = new OsuRuleset().RulesetInfo,
|
||||
StarDifficulty = i,
|
||||
StarRating = i,
|
||||
});
|
||||
}
|
||||
|
||||
@ -838,7 +838,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
return new BeatmapSetInfo
|
||||
{
|
||||
ID = id,
|
||||
OnlineBeatmapSetID = id,
|
||||
OnlineID = id,
|
||||
Hash = new MemoryStream(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())).ComputeMD5Hash(),
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
@ -867,9 +867,9 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
|
||||
yield return new BeatmapInfo
|
||||
{
|
||||
OnlineBeatmapID = id++ * 10,
|
||||
Version = version,
|
||||
StarDifficulty = diff,
|
||||
OnlineID = id++ * 10,
|
||||
DifficultyName = version,
|
||||
StarRating = diff,
|
||||
Ruleset = new OsuRuleset().RulesetInfo,
|
||||
BaseDifficulty = new BeatmapDifficulty
|
||||
{
|
||||
@ -884,7 +884,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
var toReturn = new BeatmapSetInfo
|
||||
{
|
||||
ID = id,
|
||||
OnlineBeatmapSetID = id,
|
||||
OnlineID = id,
|
||||
Hash = new MemoryStream(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())).ComputeMD5Hash(),
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
@ -900,11 +900,11 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
{
|
||||
toReturn.Beatmaps.Add(new BeatmapInfo
|
||||
{
|
||||
OnlineBeatmapID = b * 10,
|
||||
OnlineID = b * 10,
|
||||
Path = $"extra{b}.osu",
|
||||
Version = $"Extra {b}",
|
||||
DifficultyName = $"Extra {b}",
|
||||
Ruleset = rulesets.GetRuleset((b - 1) % 4),
|
||||
StarDifficulty = 2,
|
||||
StarRating = 2,
|
||||
BaseDifficulty = new BeatmapDifficulty
|
||||
{
|
||||
OverallDifficulty = 3.5f,
|
||||
|
@ -198,8 +198,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
Title = $"{ruleset.ShortName}Title"
|
||||
},
|
||||
Ruleset = ruleset,
|
||||
StarDifficulty = 6,
|
||||
Version = $"{ruleset.ShortName}Version",
|
||||
StarRating = 6,
|
||||
DifficultyName = $"{ruleset.ShortName}Version",
|
||||
BaseDifficulty = new BeatmapDifficulty()
|
||||
},
|
||||
HitObjects = objects
|
||||
@ -219,7 +219,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
Source = "Verrrrry long Source",
|
||||
Title = "Verrrrry long Title"
|
||||
},
|
||||
Version = "Verrrrrrrrrrrrrrrrrrrrrrrrrrrrry long Version",
|
||||
DifficultyName = "Verrrrrrrrrrrrrrrrrrrrrrrrrrrrry long Version",
|
||||
Status = BeatmapSetOnlineStatus.Graveyard,
|
||||
},
|
||||
};
|
||||
|
@ -388,7 +388,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
{
|
||||
leaderboard.BeatmapInfo = new BeatmapInfo
|
||||
{
|
||||
OnlineBeatmapID = 1113057,
|
||||
OnlineID = 1113057,
|
||||
Status = status,
|
||||
};
|
||||
}
|
||||
|
@ -45,8 +45,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
{
|
||||
Title = title,
|
||||
},
|
||||
Version = version,
|
||||
StarDifficulty = RNG.NextDouble(0, 10),
|
||||
DifficultyName = version,
|
||||
StarRating = RNG.NextDouble(0, 10),
|
||||
}
|
||||
}));
|
||||
}
|
||||
@ -64,8 +64,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
{
|
||||
Title = "Heavy beatmap",
|
||||
},
|
||||
Version = "10k objects",
|
||||
StarDifficulty = 99.99f,
|
||||
DifficultyName = "10k objects",
|
||||
StarRating = 99.99f,
|
||||
}
|
||||
}));
|
||||
|
||||
|
@ -180,16 +180,16 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
var beatmapSet = new BeatmapSetInfo
|
||||
{
|
||||
Hash = Guid.NewGuid().ToString(),
|
||||
OnlineBeatmapSetID = importID,
|
||||
OnlineID = importID,
|
||||
Metadata = metadata,
|
||||
Beatmaps = difficultyRulesets.Select((ruleset, difficultyIndex) => new BeatmapInfo
|
||||
{
|
||||
OnlineBeatmapID = importID * 1024 + difficultyIndex,
|
||||
OnlineID = importID * 1024 + difficultyIndex,
|
||||
Metadata = metadata,
|
||||
BaseDifficulty = new BeatmapDifficulty(),
|
||||
Ruleset = ruleset,
|
||||
StarDifficulty = difficultyIndex + 1,
|
||||
Version = $"SR{difficultyIndex + 1}"
|
||||
StarRating = difficultyIndex + 1,
|
||||
DifficultyName = $"SR{difficultyIndex + 1}"
|
||||
}).ToList()
|
||||
};
|
||||
|
||||
@ -205,8 +205,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
AddUntilStep("wait for song select", () => Game.ScreenStack.CurrentScreen is Screens.Select.SongSelect);
|
||||
AddUntilStep("recommended beatmap displayed", () =>
|
||||
{
|
||||
int? expectedID = getImport().Beatmaps[expectedDiff - 1].OnlineBeatmapID;
|
||||
return Game.Beatmap.Value.BeatmapInfo.OnlineBeatmapID == expectedID;
|
||||
int? expectedID = getImport().Beatmaps[expectedDiff - 1].OnlineID;
|
||||
return Game.Beatmap.Value.BeatmapInfo.OnlineID == expectedID;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -507,13 +507,13 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
i.IsFiltered || i.Item.BeatmapInfo.Ruleset.ID == targetRuleset || i.Item.BeatmapInfo.Ruleset.ID == 0);
|
||||
});
|
||||
|
||||
AddUntilStep("carousel has correct", () => songSelect.Carousel.SelectedBeatmapInfo?.OnlineBeatmapID == target.OnlineBeatmapID);
|
||||
AddUntilStep("game has correct", () => Beatmap.Value.BeatmapInfo.OnlineBeatmapID == target.OnlineBeatmapID);
|
||||
AddUntilStep("carousel has correct", () => songSelect.Carousel.SelectedBeatmapInfo?.OnlineID == target.OnlineID);
|
||||
AddUntilStep("game has correct", () => Beatmap.Value.BeatmapInfo.OnlineID == target.OnlineID);
|
||||
|
||||
AddStep("reset filter text", () => songSelect.FilterControl.ChildrenOfType<SearchTextBox>().First().Text = string.Empty);
|
||||
|
||||
AddAssert("game still correct", () => Beatmap.Value?.BeatmapInfo.OnlineBeatmapID == target.OnlineBeatmapID);
|
||||
AddAssert("carousel still correct", () => songSelect.Carousel.SelectedBeatmapInfo.OnlineBeatmapID == target.OnlineBeatmapID);
|
||||
AddAssert("game still correct", () => Beatmap.Value?.BeatmapInfo.OnlineID == target.OnlineID);
|
||||
AddAssert("carousel still correct", () => songSelect.Carousel.SelectedBeatmapInfo.OnlineID == target.OnlineID);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -544,8 +544,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
|
||||
AddUntilStep("has selection", () => songSelect.Carousel.SelectedBeatmapInfo != null);
|
||||
|
||||
AddUntilStep("carousel has correct", () => songSelect.Carousel.SelectedBeatmapInfo?.OnlineBeatmapID == target.OnlineBeatmapID);
|
||||
AddUntilStep("game has correct", () => Beatmap.Value.BeatmapInfo.OnlineBeatmapID == target.OnlineBeatmapID);
|
||||
AddUntilStep("carousel has correct", () => songSelect.Carousel.SelectedBeatmapInfo?.OnlineID == target.OnlineID);
|
||||
AddUntilStep("game has correct", () => Beatmap.Value.BeatmapInfo.OnlineID == target.OnlineID);
|
||||
|
||||
AddStep("set filter text", () => songSelect.FilterControl.ChildrenOfType<SearchTextBox>().First().Text = "nononoo");
|
||||
|
||||
@ -918,8 +918,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
beatmaps.Add(new BeatmapInfo
|
||||
{
|
||||
Ruleset = getRuleset(),
|
||||
OnlineBeatmapID = beatmapId,
|
||||
Version = $"{beatmapId} (length {TimeSpan.FromMilliseconds(length):m\\:ss}, bpm {bpm:0.#})",
|
||||
OnlineID = beatmapId,
|
||||
DifficultyName = $"{beatmapId} (length {TimeSpan.FromMilliseconds(length):m\\:ss}, bpm {bpm:0.#})",
|
||||
Length = length,
|
||||
BPM = bpm,
|
||||
BaseDifficulty = new BeatmapDifficulty
|
||||
@ -931,7 +931,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
|
||||
return new BeatmapSetInfo
|
||||
{
|
||||
OnlineBeatmapSetID = setId,
|
||||
OnlineID = setId,
|
||||
Hash = new MemoryStream(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())).ComputeMD5Hash(),
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
Username = "TestAuthor"
|
||||
},
|
||||
},
|
||||
Version = "Insane"
|
||||
DifficultyName = "Insane"
|
||||
},
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user