Esempio n. 1
0
        public void WeWillGetTheClassDefinitionAsWritten()
        {
            ScriptTranslator trans = new ScriptTranslator(testScript);
            trans.CreateStub();
            string newScript = trans.ToString();

            Assert.That(newScript, Is.StringContaining(testScript.First(s => s.Contains(" class "))));
        }
Esempio n. 2
0
        public void WeWillGetTheClassDefinitionAsWritten()
        {
            ScriptTranslator trans = new ScriptTranslator(testScript);

            trans.CreateStub();
            string newScript = trans.ToString();

            Assert.That(newScript, Is.StringContaining(testScript.First(s => s.Contains(" class "))));
        }
Esempio n. 3
0
 public void WeCanAddExtraUsings()
 {
     string myNamespace = "MyNamespace";
     ScriptTranslator trans = new ScriptTranslator(testScript);
     ScriptTranslator.DefaultUsings.Add(myNamespace);
     trans.CreateStub();
     string newScript = trans.ToString();
     Assert.That(newScript, Is.StringContaining("using " + myNamespace + ";"));
 }
Esempio n. 4
0
        public void WeWillRemoveOldUsings()
        {
            ScriptTranslator trans = new ScriptTranslator(testScript);

            trans.CreateStub();
            string newScript = trans.ToString();

            Assert.That(newScript, Is.Not.StringContaining("UnityEngine;"));
            Assert.That(newScript, Is.Not.StringContaining("SomeSystem;"));
        }
Esempio n. 5
0
        public void WeWillAddANamespaceAfterUsingStatements()
        {
            ScriptTranslator.ScriptNamespace = "TestNamespace";
            ScriptTranslator trans = new ScriptTranslator(testScript);
            trans.CreateStub();
            string newScript = trans.ToString();

            Assert.That(newScript, Is.StringContaining(ScriptTranslator.ScriptNamespace));
            Assert.That(newScript.IndexOf("using"), Is.LessThan(newScript.IndexOf(ScriptTranslator.ScriptNamespace)));
        }
Esempio n. 6
0
        public void AllCodeInTheClassWillBeRemoved()
        {
            ScriptTranslator trans = new ScriptTranslator(testScript);
            trans.CreateStub();
            string newScript = trans.ToString();

            Assert.That(newScript, Is.Not.StringContaining(testScript.First(s => s.Contains("Start()"))));
            Assert.That(newScript, Is.Not.StringContaining(testScript.First(s => s.Contains("Vector3"))));
            Assert.That(newScript, Is.Not.StringContaining(testScript.First(s => s.Contains("Update()"))));
        }
Esempio n. 7
0
        public void AllCodeInTheClassWillBeRemoved()
        {
            ScriptTranslator trans = new ScriptTranslator(testScript);

            trans.CreateStub();
            string newScript = trans.ToString();

            Assert.That(newScript, Is.Not.StringContaining(testScript.First(s => s.Contains("Start()"))));
            Assert.That(newScript, Is.Not.StringContaining(testScript.First(s => s.Contains("Vector3"))));
            Assert.That(newScript, Is.Not.StringContaining(testScript.First(s => s.Contains("Update()"))));
        }
Esempio n. 8
0
        public void WeWillAddANamespaceAfterUsingStatements()
        {
            ScriptTranslator.ScriptNamespace = "TestNamespace";
            ScriptTranslator trans = new ScriptTranslator(testScript);

            trans.CreateStub();
            string newScript = trans.ToString();

            Assert.That(newScript, Is.StringContaining(ScriptTranslator.ScriptNamespace));
            Assert.That(newScript.IndexOf("using"), Is.LessThan(newScript.IndexOf(ScriptTranslator.ScriptNamespace)));
        }
Esempio n. 9
0
        public void WeCanAddExtraUsings()
        {
            string           myNamespace = "MyNamespace";
            ScriptTranslator trans       = new ScriptTranslator(testScript);

            ScriptTranslator.DefaultUsings.Add(myNamespace);
            trans.CreateStub();
            string newScript = trans.ToString();

            Assert.That(newScript, Is.StringContaining("using " + myNamespace + ";"));
        }
Esempio n. 10
0
        public void WeWillAddTheDefinedUsings()
        {
            ScriptTranslator trans = new ScriptTranslator(testScript);
            trans.CreateStub();
            string newScript = trans.ToString();

            foreach (string u in ScriptTranslator.DefaultUsings)
            {
                Assert.That(newScript, Is.StringContaining("using " + u + ";"));
            }
        }
Esempio n. 11
0
        public void WeWillAddTheDefinedUsings()
        {
            ScriptTranslator trans = new ScriptTranslator(testScript);

            trans.CreateStub();
            string newScript = trans.ToString();

            foreach (string u in ScriptTranslator.DefaultUsings)
            {
                Assert.That(newScript, Is.StringContaining("using " + u + ";"));
            }
        }
Esempio n. 12
0
 public void WeWillRemoveOldUsings()
 {
     ScriptTranslator trans = new ScriptTranslator(testScript);
     trans.CreateStub();
     string newScript = trans.ToString();
     Assert.That(newScript, Is.Not.StringContaining("UnityEngine;"));
     Assert.That(newScript, Is.Not.StringContaining("SomeSystem;"));
 }