Skip to content

Commit

Permalink
Add: AddTo test
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnulusGames committed Jan 16, 2024
1 parent a5e49ff commit 01b1aae
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/LitMotion/Assets/LitMotion/Tests/Runtime/AddToTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.Collections;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;

namespace LitMotion.Tests.Runtime
{
public class AddToTest
{
[UnityTest]
public IEnumerator Test_AddTo()
{
var canceled = false;
var obj = new GameObject("Target");
var handle = LMotion.Create(0f, 1f, 2f)
.WithOnCancel(() => canceled = true)
.RunWithoutBinding()
.AddTo(obj);
yield return new WaitForSeconds(0.1f);
Object.DestroyImmediate(obj);
Assert.IsTrue(canceled);
}
}
}
11 changes: 11 additions & 0 deletions src/LitMotion/Assets/LitMotion/Tests/Runtime/AddToTest.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 01b1aae

Please sign in to comment.