public void RegisterScopeMultipleTime() { Assert.DoesNotThrow(OneTime.Register <ScopeLocal>); Assert.Throws <ArgumentException>(OneTime.Register <ScopeLocal>); OneTime.Unregsiter <ScopeLocal>(); }
public void ScopeLocalTest() { AssetScope <ScopeLocal>("Test"); var scene = SceneManager.CreateScene("ScopeLocalTestScene"); SceneManager.SetActiveScene(scene); Assert.IsFalse(OneTime.Get <ScopeLocal>()["Test"]); }
public void UnregisterRegisteredScope() { OneTime.Register <ScopeLocal>(); Assert.DoesNotThrow(OneTime.Unregsiter <ScopeLocal>); }
public void SetUp() { OneTime.Register <ScopeLocal>(); OneTime.Register <ScopeScene <ScopeLocal> >(); }
static void AssetScope <T>(string testString) where T : Scope, new() { Assert.IsTrue(OneTime.Get <T>()[testString]); Assert.IsFalse(OneTime.Get <T>()[testString]); }