public void WriteApplicationDefinition_EnsureNameGetsWrittenCorrectly()
        {
            //ARRANGE
            var application = new Application();

            application.Name = "appName";
            application.Guid = "635c6cbe-e370-49e8-be45-059fa5979ad5";

            //ACT
            var writer = new ApplicationWriter();
            var text   = writer.WriteApplicationDefinition(application);

            //ASSERT
            var props = ParseTestHelper.GetClassDefinition(text).Members.ToArray();

            Assert.Equal("public const string Name = \"appName\";", props[0].ToString(), ignoreWhiteSpaceDifferences: true);
            Assert.Equal("public const string Guid = \"635c6cbe-e370-49e8-be45-059fa5979ad5\";", props[1].ToString(), ignoreWhiteSpaceDifferences: true);
        }
Esempio n. 2
0
        public void WriteScripts_ScriptGuidCorrect()
        {
            //ARRANGE
            var app = new Application();

            app.Tabs = new List <Tab> {
                new Tab
                {
                    Name = "testTab",
                    Guid = "ac4a4f4c-b9af-4c87-8fb4-35ca0f4a9b63"
                }
            };

            //ACT
            var writer = new TabWriter();
            var text   = writer.WriteTabGuids(app);

            //ASSERT
            var properties = ParseTestHelper.GetClassDefinition(text).Members.First();

            Assert.Equal("public const string testTab = \"ac4a4f4c-b9af-4c87-8fb4-35ca0f4a9b63\";", properties.ToString(), ignoreWhiteSpaceDifferences: true);
        }
Esempio n. 3
0
        public void WriteScripts_ScriptGuidCorrect()
        {
            //ARRANGE
            var app = new Application();

            app.Scripts = new List <Script> {
                new Script
                {
                    Name = "testScript",
                    Guid = "ac4a4f4c-b9af-4c87-8fb4-35ca0f4a9b63"
                }
            };

            //ACT
            var writer = new ScriptWriter();
            var text   = writer.WriteScripts(app);

            //ASSERT
            var classDefinition = ParseTestHelper.GetClassDefinition(text);
            var properties      = (FieldDeclarationSyntax)classDefinition.Members[0];

            Assert.Equal("public const string testScript = \"ac4a4f4c-b9af-4c87-8fb4-35ca0f4a9b63\";", properties.ToString(), ignoreWhiteSpaceDifferences: true);
        }