Пример #1
0
        public void RegisterScopeMultipleTime()
        {
            Assert.DoesNotThrow(OneTime.Register <ScopeLocal>);
            Assert.Throws <ArgumentException>(OneTime.Register <ScopeLocal>);

            OneTime.Unregsiter <ScopeLocal>();
        }
Пример #2
0
        public void ScopeLocalTest()
        {
            AssetScope <ScopeLocal>("Test");

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

            SceneManager.SetActiveScene(scene);

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