예제 #1
0
        public void ShouldSaveScript()
        {
            const string expectedContent = "public class Test { }";
            const string expectedPath    = ScriptDirectory + "/TestScript.cs";

            ScriptUtils.SaveScript(
                expectedContent,
                ScriptDirectory,
                "TestScript"
                );

            var fileContent = File.ReadAllText(expectedPath);

            Assert.AreEqual(expectedContent, fileContent);
        }
예제 #2
0
        public void ShouldSaveScriptWithNamespaceDirectories()
        {
            const string expectedContent = "public class Test { }";
            const string expectedPath    = ScriptDirectory + "/Project/Namespace/TestScript.cs";

            ScriptUtils.SaveScript(
                expectedContent,
                ScriptDirectory,
                "TestScript",
                "Project.Namespace"
                );

            var fileContent = File.ReadAllText(expectedPath);

            Assert.AreEqual(expectedContent, fileContent);
        }