Ejemplo n.º 1
0
        public void ApplyWithNamingConventionConvertion(NamingConventionEnum ruleNamingConvention, NamingConventionEnum dataNamingConvention, string ruleJson,
                                                        object data, object expectedResult)
        {
            // Arrange
            var rules     = JsonFrom(ruleJson);
            var jsonLogic = new JsonLogicEvaluator(EvaluateOperators.Default(ruleNamingConvention, dataNamingConvention));

            _output.WriteLine($"{MethodBase.GetCurrentMethod().Name}() Testing {rules} against {data}");

            // Act
            var actualResult = jsonLogic.Apply(rules, data);

            // Act & Assert
            Assert.Equal(expectedResult, actualResult);
        }
Ejemplo n.º 2
0
        public static void CreateDbContext(string srcDirectory,
                                           List <Entity> entities,
                                           string dbContextName,
                                           string dbProvider,
                                           string dbName,
                                           NamingConventionEnum namingConventionEnum,
                                           string projectBaseName,
                                           IFileSystem fileSystem
                                           )
        {
            var classPath = ClassPathHelper.DbContextClassPath(srcDirectory, $"{dbContextName}.cs", projectBaseName);
            var data      = GetContextFileText(classPath.ClassNamespace, entities, dbContextName, srcDirectory, projectBaseName);

            Utilities.CreateFile(classPath, data, fileSystem);

            RegisterContext(srcDirectory, dbProvider, dbContextName, dbName, namingConventionEnum, projectBaseName);
        }
Ejemplo n.º 3
0
 public NamingConventionConverter(NamingConventionEnum sourceNamingConvention, NamingConventionEnum targetNamingConvention)
 {
     this.sourceNamingConvention = sourceNamingConvention;
     this.targetNamingConvention = targetNamingConvention;
 }