Beispiel #1
0
        public void ApplyExistingCodeTemplate_Does_Not_Throw_Error()
        {
            // Arrange
            SqlTemplate testTemplate =
                new SqlTemplate()
            {
                ExistingCodeTemplateArray = new List <string>()
                {
                    "this is a test", "to see if the lines", "join with return carriage", "###ReplaceMe###"
                },
                SqlCodeTemplateArray = new List <string> {
                    "###ReplaceMe###"
                },
                Name             = "test template",
                OutputDirectory  = "c:\\test\\",
                ReplaceMentChars = new List <string> {
                    "###ReplaceMe###"
                }
            };

            _fileAccess.Setup(method => method.GetFileNames(_settings.Value.RoleBackScriptLocation, FileExtensions.sql))
            .Returns(new List <string>()
            {
                "14mockscript1.sql", "12mockscript2.sql", "13_mockscript3.sql"
            });



            // Act

            // Assert
            Assert.DoesNotThrow(() => _processTemplate.ApplyExistingCodeTemplate("test.sql", testTemplate));
        }