mirror of https://github.com/ppy/osu
Add test coverage of expected behaviour for playback of loops with no explicit end time
This commit is contained in:
parent
3919400be2
commit
dce0c5fac8
|
@ -95,6 +95,25 @@ public void TestDecodeStoryboardEvents()
|
|||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLoopWithoutExplicitFadeOut()
|
||||
{
|
||||
var decoder = new LegacyStoryboardDecoder();
|
||||
|
||||
using (var resStream = TestResources.OpenResource("animation-loop-no-explicit-end-time.osb"))
|
||||
using (var stream = new LineBufferedReader(resStream))
|
||||
{
|
||||
var storyboard = decoder.Decode(stream);
|
||||
|
||||
StoryboardLayer background = storyboard.Layers.Single(l => l.Depth == 3);
|
||||
Assert.AreEqual(1, background.Elements.Count);
|
||||
|
||||
Assert.AreEqual(2000, background.Elements[0].StartTime);
|
||||
Assert.AreEqual(2000, (background.Elements[0] as StoryboardAnimation)?.EarliestTransformTime);
|
||||
Assert.AreEqual(12000, (background.Elements[0] as StoryboardAnimation)?.GetEndTime());
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCorrectAnimationStartTime()
|
||||
{
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
[Events]
|
||||
//Storyboard Layer 0 (Background)
|
||||
Animation,Background,Centre,"img.jpg",320,240,2,150,LoopForever
|
||||
F,0,2000,,0,1
|
||||
L,2000,10
|
||||
F,18,0,1000,1,0
|
Loading…
Reference in New Issue