public void ModelCompile_Compiles() { var som = Environment.GetEnvironmentVariable("som", EnvironmentVariableTarget.User); var config = new TestServices().Configuration; var logger = new Mock <ILogger>().Object; var cache = new CacheService(config, logger); ISomContext somContext = new SomContext(config, logger, cache); var compiler = new Compiler(somContext); compiler.Source = som; compiler.FileFilter = "*.som"; compiler.ContentCompilers.Add(new ModelCompile("aspnet_Users", ".*")); compiler.Compile(); cache.Inspect(); Assert.IsNotNull(compiler); }
public void Regex_Compiles() { var som = Environment.GetEnvironmentVariable("som", EnvironmentVariableTarget.User); var config = new TestServices().Configuration; var logger = new Mock <ILogger>().Object; var cache = new CacheService(config, logger); ISomContext somContext = new SomContext(config, logger, cache); var compiler = new Compiler(somContext); compiler.Source = som; compiler.FileFilter = "*.som"; compiler.ContentCompilers.Add(new RegexReplacer("{\"FOO\":\"BAR\"}")); compiler.ContentCompilers.Add(new NumericIncrementer(1000, 2000, @"\d{4}")); compiler.Compile(); cache.Inspect(); Assert.IsNotNull(compiler); }
public void Inserter_Inserts() { string readall = File.ReadAllText(@"D:\dev\CyberScope\CyberScopeBranch\CSwebdev\code\CyberScope\FismaForms\2022\2022_A_IG_0.aspx"); var config = new TestServices().Configuration; var logger = new Mock <ILogger>().Object; var cache = new CacheService(config, logger); ISomContext somContext = new SomContext(config, logger, cache) { Content = readall }; var obj = new Insert(@"(<tr>.*?SectionHead.*?<\/tr>)", "<tr><td colspan='6'></td></tr>", @"$1\n$2\n"); somContext.Content = obj.Compile(somContext); //obj = new Inserter(@"using SOM\.Procedures", "FOO"); //result = obj.Compile(somContext); Assert.IsNotNull(somContext.Content); }
public void KeyValReplacer_Provides() { string readall = @" 1-1-1 1-2-1.1 "; var config = new TestServices().Configuration; var logger = new Mock <ILogger>().Object; var cache = new CacheService(config, logger); ISomContext somContext = new SomContext(config, logger, cache) { Content = readall }; var obj = new KeyValReplacer(@"C:\Users\Tim\Documents\SQL Server Management Studio\SQLQuery1.sql"); somContext.Content = obj.Compile(somContext); Assert.IsNotNull(somContext.Content); }