예제 #1
0
        public void RemoveItemWithComments()
        {
            var penis = new PENIS(File);


            penis.Remove("Hey");

            Assert.AreEqual(@"#comment
Ints:
    - 1 #comment
    - 2
    - 3
#another comment

Recursion:
    Ints:
        - 4
        - 5
        - 6
    Hey: no

#before
#it's ending
", penis.Serialize());
        }
예제 #2
0
파일: Program.cs 프로젝트: pipe01/PiENIS
        static void Main(string[] args)
        {
            const string str = @"#first comment
some: element #inline comment
#another comment

other: element #in
#le comment";

            var file = new MemoryFile(str);
            var s    = new PENIS(file);

            Console.WriteLine(file.Content);

            s.Set("other", "i don't know");
            s.Save();
            Console.WriteLine("=============================");
            Console.WriteLine(file.Content);

            s.Remove("some");
            s.Save();
            Console.WriteLine("=============================");
            Console.WriteLine(file.Content);
            Console.ReadKey(true);
        }
예제 #3
0
        public void RemoveListItemWithComments()
        {
            var penis = new PENIS(File);

            penis.Remove("Ints");

            Assert.AreEqual(penis.Serialize(), @"#comment
#another comment

Recursion:
    Ints:
        - 4
        - 5
        - 6
    Hey: no

#before
Hey: what's up #not much, hbu
#it's ending
");
        }