예제 #1
0
        static void Main(string[] args)
        {
            var generator = new TestGenerator();
            var ib = new InviromentBuild()
            {
                Instructions = new Component[TestInstructionCount],
                Components = new Component[TestCount],
            };

            for (int i = 0; i < TestInstructionCount; i++)
            {
                var instruction = generator.Generate("Instruction" + i, true);
                ib.Instructions[i] = instruction;
            }
            for (var i = 0; i < TestCount; i++)
            {
                var component = generator.Generate("Component" + i, false);
                ib.Components[i] = component;
            }

            using (var file = File.CreateText("database.json"))
            {
                var componentString = JsonConvert.SerializeObject(ib);
                file.Write(componentString);
            }
            Console.Read();
        }
예제 #2
0
        public void Initialize()
        {
            resultPath = Environment.CurrentDirectory + "\\Tests";
            aw         = new AsyncWriter(resultPath);

            files = new List <string>();
            string pathToFile1 = Environment.CurrentDirectory + "\\..\\..\\..\\TestGeneratorTest.cs";

            files.Add(pathToFile1);

            maxReadableCount    = 3;
            maxProcessableCount = 3;
            maxWritableCount    = 3;
            testsGenerator      = new TestGenerator.TestGenerator(files, maxReadableCount, maxProcessableCount, maxWritableCount);
        }
예제 #3
0
        static void Main()
        {
            List <string> inputFiles = new List <string>();

            inputFiles.Add("../../../../Classes/Class1.cs");
            inputFiles.Add("../../../../Classes/Classes.cs");

            TestGenerator.TestGenerator generator =
                new TestGenerator.TestGenerator(inputFiles, 2, 2, 2);

            AsyncWriter asyncWriter = new AsyncWriter("../../../../Tests");

            generator.Generate(asyncWriter).Wait();

            Console.WriteLine("Generation completed");
            Console.ReadKey();
        }