Example #1
0
        public static void GenerateModelAndTests(Schema objectTypeDescription)
        {
            var objTypeNames           = (from o in _objectTypes select o.GetAttrValue("Name")).ToList();
            IdmCodeGenerator generator = new IdmCodeGenerator(objectTypeDescription, objTypeNames, _json);

            Tuple <string, string> classAndTests = generator.Generate();
            var classFile = $@"{TargetDirectoryPath}{objectTypeDescription.Name}.cs";

            File.WriteAllText(classFile, classAndTests.Item1);

            var testsFile = $@"{TargetDirectoryPath}Tests\{objectTypeDescription.Name}Tests.cs";

            File.WriteAllText(testsFile, classAndTests.Item2);
        }
Example #2
0
        public static void GenerateModelAndTests(Schema objectTypeDescription)
        {
            var objTypeNames = (from o in _objectTypes select o.GetAttrValue("Name")).ToList();
            IdmCodeGenerator generator = new IdmCodeGenerator(objectTypeDescription, objTypeNames, _json);

            Tuple<string, string> classAndTests = generator.Generate();
            var classFile = $@"{TargetDirectoryPath}{objectTypeDescription.Name}.cs";
            File.WriteAllText(classFile, classAndTests.Item1);

            var testsFile = $@"{TargetDirectoryPath}Tests\{objectTypeDescription.Name}Tests.cs";
            File.WriteAllText(testsFile, classAndTests.Item2);
        }