Skip to content

Commit

Permalink
Merge pull request #162 from andy840119/add-test-case-for-reverse
Browse files Browse the repository at this point in the history
Add test case for reverse time-tags.
  • Loading branch information
andy840119 authored Apr 29, 2022
2 parents 8613b6e + 69097dc commit d631d77
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ public TestSceneKaraokeSpriteText()
};
}

[TestCase(new[] { "[0,start]:500", "[1,start]:600", "[2,start]:1000", "[3,start]:1500", "[4,start]:2000" }, true)] // Normal time-tag.
[TestCase(new[] { "[0,start]:0", "[0,end]:100", "[1,start]:1000", "[1,end]:1100", "[2,start]:2000", "[2,end]:2100", "[3,start]:3000", "[3,end]:3100", "[4,start]:4000", "[4,end]:4100" }, true)]
[TestCase(new[] { "[-1,start]:0", "[0,start]:500", "[1,end]:600", "[2,start]:1000", "[3,end]:1500", "[4,end]:2000", "[8,end]:2500" }, true)] // Out-of-range time-tag, but it's acceptable now.
[TestCase(new[] { "[0,start]:500" }, true)] // Only one time-tag.
public void TestKaraokeSpriteTextTimeTags(string[] timeTags, bool boo)
[TestCase("Normal", new[] { "[0,start]:500", "[1,start]:600", "[2,start]:1000", "[3,start]:1500", "[4,start]:2000" })] // Normal time-tag.
[TestCase("Normal 2", new[] { "[0,start]:0", "[0,end]:100", "[1,start]:1000", "[1,end]:1100", "[2,start]:2000", "[2,end]:2100", "[3,start]:3000", "[3,end]:3100", "[4,start]:4000", "[4,end]:4100" })]
[TestCase("Out of range", new[] { "[-1,start]:0", "[0,start]:500", "[1,end]:600", "[2,start]:1000", "[3,end]:1500", "[4,end]:2000", "[8,end]:2500" })] // Out-of-range time-tag, but it's acceptable now.
[TestCase("Reverse", new[] { "[4,start]:2000", "[3,start]:1500", "[2,start]:1000", "[1,start]:600", "[0,start]:500" })] // Reverse order.
[TestCase("Reverse index", new[] { "[0,start]:2000", "[1,start]:1500", "[2,start]:1000", "[3,start]:600", "[4,start]:500" })] // Normal time-tag with reverse time(will have reverse effect).
[TestCase("Reverse time", new[] { "[4,start]:500", "[3,start]:600", "[2,start]:1000", "[1,start]:1500", "[0,start]:2000" })] // Reverse time-tag with non-reverse time(will have reverse effect).
[TestCase("One", new[] { "[0,start]:500" })] // Only one time-tag.
public void TestKaraokeSpriteTextTimeTags(string name, string[] timeTags)
{
AddStep("Apply time-tags", () =>
AddStep($"Apply \"{name}\" time-tags", () =>
{
var startTime = Clock.CurrentTime;

Expand Down

0 comments on commit d631d77

Please sign in to comment.