public void Setup() => Schedule(() => { Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.SlateGray }, grid = new TestDistanceSnapGrid() }; });
private void createGrid(Action <TestDistanceSnapGrid> func = null, string description = null) { AddStep($"create grid {description ?? string.Empty}", () => { Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.SlateGray }, grid = new TestDistanceSnapGrid(new HitObject(), grid_position) }; func?.Invoke(grid); }); }
public void TestLimitedDistance(double multiplier) { const int end_time = 100; AddStep("create limited grid", () => { Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.SlateGray }, grid = new TestDistanceSnapGrid(end_time) }; }); AddStep($"set distance spacing = {multiplier}", () => snapProvider.DistanceSpacingMultiplier.Value = multiplier); AddStep("check correct interval count", () => Assert.That((end_time / grid.DistanceBetweenTicks) * multiplier, Is.EqualTo(grid.MaxIntervals))); }