Example #1
0
        static void GenerateForRep(int count, string filename, string format)
        {
            List <Repository> tw = new List <Repository>();

            for (int i = 0; i < count; i++)
            {
                tw.Add(new Repository(GeneratorString.Generate(), GeneratorString.Generate()));
            }
            StreamWriter writer = new StreamWriter(filename);

            if (format == "csv")
            {
                WriteRepToCsvFile(tw, writer);
            }
            else if (format == "xml")
            {
                WriteRepToFile(tw, writer);
            }
            else
            {
                Console.Out.Write("Unrecognized format" + format);
            }
            writer.Close();
        }