Beispiel #1
0
        public void TestSequence()
        {
            var writer  = new StringWriter();
            var builder = new CTFBuilder(writer, 0, false);

            builder.AddDenseSample("a", new float[] { 1, 2, 3 });
            builder.NextLine();
            builder.AddDenseSample("b", new float[] { 3.14f });
            builder.NextLine();
            builder.NextSequence();
            builder.AddDenseSample("c", new float[] { 5 });
            builder.AddDenseSample("d", new float[] { 10 });
            builder.NextLine();

            builder.Finish();

            var s = writer.ToString();

            Assert.AreEqual("0\t|a 1 2 3\r\n0\t|b 3.14\r\n1\t|c 5\t|d 10", s);
        }
Beispiel #2
0
        public void TestNextLine()
        {
            var writer  = new StringWriter();
            var builder = new CTFBuilder(writer);

            builder.AddDenseSample("a", new float[] { 1, 2, 3 });
            builder.NextLine();
            builder.AddDenseSample("b", new float[] { 3.14f });

            builder.Finish();

            var s = writer.ToString();

            Assert.AreEqual("0\t|a 1 2 3\r\n1\t|b 3.14", s);
        }