mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-23 00:38:47 +00:00
Allow for minor differentiation in equality test
This commit is contained in:
parent
b09b2287d2
commit
af622a8ef7
@ -14,39 +14,39 @@ namespace X10D.Unity.Tests
|
|||||||
{
|
{
|
||||||
int frameCount = UTime.frameCount;
|
int frameCount = UTime.frameCount;
|
||||||
yield return new WaitForFrames(10);
|
yield return new WaitForFrames(10);
|
||||||
Assert.AreEqual(frameCount + 10, UTime.frameCount);
|
Assert.AreEqual(frameCount + 10, UTime.frameCount, $"{frameCount + 10} == {UTime.frameCount}");
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator WaitForSecondsNoAlloc_ShouldYieldForCorrectTime()
|
public IEnumerator WaitForSecondsNoAlloc_ShouldYieldForCorrectTime()
|
||||||
{
|
{
|
||||||
var time = (int)UTime.time;
|
float time = UTime.time;
|
||||||
yield return new WaitForSecondsNoAlloc(2);
|
yield return new WaitForSecondsNoAlloc(2);
|
||||||
Assert.AreEqual(time + 2, (int)UTime.time);
|
Assert.AreEqual(time + 2, UTime.time, 1e-2, $"{time + 2} == {UTime.time}");
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator WaitForSecondsRealtimeNoAlloc_ShouldYieldForCorrectTime()
|
public IEnumerator WaitForSecondsRealtimeNoAlloc_ShouldYieldForCorrectTime()
|
||||||
{
|
{
|
||||||
var time = (int)UTime.time;
|
float time = UTime.time;
|
||||||
yield return new WaitForSecondsRealtimeNoAlloc(2);
|
yield return new WaitForSecondsRealtimeNoAlloc(2);
|
||||||
Assert.AreEqual(time + 2, (int)UTime.time);
|
Assert.AreEqual(time + 2, UTime.time, 1e-2, $"{time + 2} == {UTime.time}");
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator WaitForTimeSpan_ShouldYieldForCorrectTime()
|
public IEnumerator WaitForTimeSpan_ShouldYieldForCorrectTime()
|
||||||
{
|
{
|
||||||
var time = (int)UTime.time;
|
float time = UTime.time;
|
||||||
yield return new WaitForTimeSpan(TimeSpan.FromSeconds(2));
|
yield return new WaitForTimeSpan(TimeSpan.FromSeconds(2));
|
||||||
Assert.AreEqual(time + 2, (int)UTime.time);
|
Assert.AreEqual(time + 2, UTime.time, 1e-2, $"{time + 2} == {UTime.time}");
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnityTest]
|
[UnityTest]
|
||||||
public IEnumerator WaitForTimeSpanRealtime_ShouldYieldForCorrectTime()
|
public IEnumerator WaitForTimeSpanRealtime_ShouldYieldForCorrectTime()
|
||||||
{
|
{
|
||||||
var time = (int)UTime.time;
|
float time = UTime.time;
|
||||||
yield return new WaitForTimeSpanRealtime(TimeSpan.FromSeconds(2));
|
yield return new WaitForTimeSpanRealtime(TimeSpan.FromSeconds(2));
|
||||||
Assert.AreEqual(time + 2, (int)UTime.time);
|
Assert.AreEqual(time + 2, UTime.time, 1e-2, $"{time + 2} == {UTime.time}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user