-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e67bc08
commit 2221d59
Showing
6 changed files
with
486 additions
and
2 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
DevProject/Assets/ML-Agents/Scripts/Tests/Runtime/AcademyTest/AcademyStepperTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Collections; | ||
using NUnit.Framework; | ||
using UnityEngine.TestTools; | ||
using UnityEngine; | ||
using UnityEngine.SceneManagement; | ||
using Unity.MLAgents; | ||
#if UNITY_EDITOR | ||
using UnityEditor.SceneManagement; | ||
#endif | ||
|
||
namespace Tests | ||
{ | ||
public class AcademyStepperTest | ||
{ | ||
[SetUp] | ||
public void Setup() | ||
{ | ||
SceneManager.LoadScene("ML-Agents/Scripts/Tests/Runtime/AcademyTest/AcademyStepperTestScene"); | ||
} | ||
|
||
/// <summary> | ||
/// Verify in each update, the Academy is only stepped once. | ||
/// </summary> | ||
[UnityTest] | ||
public IEnumerator AcademyStepperCleanupPasses() | ||
{ | ||
var academy = Academy.Instance; | ||
int initStepCount = academy.TotalStepCount; | ||
for (var i = 0; i < 5; i++) | ||
{ | ||
yield return new WaitForFixedUpdate(); | ||
Assert.True(academy.TotalStepCount - initStepCount == i + 1); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.