コード例 #1
0
        public void t2_create_csvfile_and_write_content()
        {
            TextWriter t = new TextWriter("dest_file", "csv");
            CsvWriter  c = new CsvWriter(t);

            Assert.DoesNotThrow(() => c.AddCell(""));
            c.AddCell("A1");
            c.AddCell("A2");
            c.NewLine();
            c.AddCell("B1");
            c.AddCell("B2");

            FileInfo f = new FileInfo(t.FilePath);

            Assert.That(File.Exists(t.FilePath), Is.EqualTo(true));
            Assert.That(f.Length, Is.Not.Null);
        }
コード例 #2
0
        public void t1_can_create_file_for_detail_of_class()
        {
            TextWriter txt = new TextWriter("count_method_and_property", "csv");
            CsvWriter  csv = new CsvWriter(txt);

            csv.AddCell("Nom de classe");
            csv.AddCell("Nombre de méthodes");
            csv.AddCell("Nombre de propriété");
            csv.NewLine();
            CSharpDocReader csharp = new CSharpDocReader();

            //On charge les élements de la classe
            csharp.LoadClassElements("CsvWriter");
            csv.AddCell("CsvWriter");
            Assert.That(csharp.CountMethodofClass("CsvWriter"), Is.EqualTo(3));
            csv.AddCell(csharp.CountMethodofClass("CsvWriter").ToString());
            Assert.That(csharp.CountPropertyofClass("CsvWriter"), Is.EqualTo(2));
            csv.AddCell(csharp.CountPropertyofClass("CsvWriter").ToString());
            csv.NewLine();
        }