refactor, test: use RaindropLoader for all full-integration tests

This commit is contained in:
alexiscatnip
2022-08-06 02:43:06 +08:00
committed by alexiscatnip
parent 827ecfea77
commit 8b9fcdef8d
6 changed files with 35 additions and 19 deletions
@@ -1,5 +1,6 @@
using System.Collections;
using NUnit.Framework;
using Raindrop.Bootstrap;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.TestTools;
@@ -12,14 +13,13 @@ namespace Raindrop.Tests.RaindropFullIntegrationTests
[UnityTest]
public IEnumerator StaticCacheCopier_Test()
{
SceneManager.LoadScene("Raindrop/Bootstrap/BootstrapScene");
RaindropLoader.Load();
yield return new WaitForSeconds(3);
Assert.True(StaticFilesCopier.GetInstance().CopyIsDoneAndNoErrors);
RaindropLoader.Unload();
}
}
}
@@ -2,6 +2,7 @@
using NUnit.Framework;
using OpenMetaverse;
using Plugins.CommonDependencies;
using Raindrop.Bootstrap;
using Raindrop.Services;
using Raindrop.Tests.RaindropFullIntegrationTests.InputSubroutines;
using UnityEngine;
@@ -49,7 +50,7 @@ namespace Raindrop.Tests.RaindropFullIntegrationTests
// 4. restart the ui and check it is showing welcome screen
public IEnumerator Can_Accept_EULA()
{
SceneManager.LoadScene("Raindrop/Bootstrap/BootstrapScene");
RaindropLoader.Load();
yield return new WaitForSeconds(2);
//1. reject the EULA
@@ -87,6 +88,8 @@ namespace Raindrop.Tests.RaindropFullIntegrationTests
{
Assert.Pass();
}
RaindropLoader.Unload();
yield break;
}
}
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using NUnit.Framework;
using Plugins.CommonDependencies;
using Raindrop.Bootstrap;
using Raindrop.Netcom;
using Raindrop.Services;
using Raindrop.Tests.RaindropFullIntegrationTests.InputSubroutines;
@@ -26,15 +27,13 @@ namespace Raindrop.Tests.RaindropFullIntegrationTests
public void OneTimeSetUp()
{
//load the main scene.
SceneManager.LoadScene("Raindrop/Bootstrap/BootstrapScene");
RaindropLoader.Load();
}
[OneTimeTearDown]
public void OneTimeTearDown()
{
//unload raindropInstance.
instance.CleanUp(); // todo: this will do for now, but we should use RaindropBootstrapper.Quit_Application() for full teardown (which includes netcom).
// instance.CleanUp();
RaindropLoader.Unload();
}
[UnityTest]
@@ -1,6 +1,7 @@
using System.Collections;
using NUnit.Framework;
using Plugins.CommonDependencies;
using Raindrop.Bootstrap;
using Raindrop.Map.Model;
using UnityEngine;
using UnityEngine.SceneManagement;
@@ -17,7 +18,13 @@ namespace Raindrop.Tests.RaindropFullIntegrationTests
public void OneTimeSetUp()
{
//load the main scene.
SceneManager.LoadScene("Raindrop/Bootstrap/BootstrapScene");
RaindropLoader.Load();
}
[OneTimeTearDown]
public void OneTimeTearDown()
{
RaindropLoader.Unload();
}
// test that the (external) map fetcher code is working.
@@ -3,6 +3,7 @@ using System.IO;
using Disk;
using NUnit.Framework;
using OpenMetaverse;
using Raindrop.Bootstrap;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.TestTools;
@@ -20,7 +21,7 @@ namespace Tests.Raindrop.RaindropIntegrationTests
DeleteLocalCacheFiles();
// 2. start main scene, which includes the startupCopier
SceneManager.LoadScene("Raindrop/Bootstrap/BootstrapScene");
RaindropLoader.Load();
//wait for abit...
yield return new WaitForSeconds(10);
@@ -29,12 +30,10 @@ namespace Tests.Raindrop.RaindropIntegrationTests
"grids.xml");
Assert.True(File.Exists(expectedToExist),"file not exist: " + expectedToExist);
//
// SceneManager.LoadScene("Scenes/empty");
// SceneManager.UnloadSceneAsync("Raindrop/Bootstrap/BootstrapScene");
// yield return new WaitForSeconds(2);
// 3. don't forget to unload the scene!
RaindropLoader.Unload();
yield break;
}
@@ -1,3 +1,11 @@
fileFormatVersion: 2
guid: 021b88811717459fb1339d40a8d4f6cb
timeCreated: 1643179061
fileFormatVersion: 2
guid: 100f80f8b4fb3664ca6fe482fcae6abf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: