Exemplo n.º 1
0
        public void RegisterScopeMultipleTime()
        {
            Assert.DoesNotThrow(OneTime.Register <ScopeLocal>);
            Assert.Throws <ArgumentException>(OneTime.Register <ScopeLocal>);

            OneTime.Unregsiter <ScopeLocal>();
        }
Exemplo n.º 2
0
        public void ScopeLocalTest()
        {
            AssetScope <ScopeLocal>("Test");

            var scene = SceneManager.CreateScene("ScopeLocalTestScene");

            SceneManager.SetActiveScene(scene);

            Assert.IsFalse(OneTime.Get <ScopeLocal>()["Test"]);
        }
Exemplo n.º 3
0
 public void UnregisterRegisteredScope()
 {
     OneTime.Register <ScopeLocal>();
     Assert.DoesNotThrow(OneTime.Unregsiter <ScopeLocal>);
 }
Exemplo n.º 4
0
 public void SetUp()
 {
     OneTime.Register <ScopeLocal>();
     OneTime.Register <ScopeScene <ScopeLocal> >();
 }
Exemplo n.º 5
0
 static void AssetScope <T>(string testString) where T : Scope, new()
 {
     Assert.IsTrue(OneTime.Get <T>()[testString]);
     Assert.IsFalse(OneTime.Get <T>()[testString]);
 }