System.Collections.Generic.List.Add(test)

Here are the examples of the csharp api System.Collections.Generic.List.Add(test) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 View Source File : FileSystemNodeTest.cs
License : Creative Commons Zero v1.0 Universal
Project Creator : NextGenSoftwareUK

[TestMethod]
        public async Task Serialization()
        {
            var ipfs = TestFixture.Ipfs;
       /*     var a = await ipfs.FileSystem.AddTextAsync("hello world");
            replacedert.AreEqual("Qmf412jQZiuVUtdgnB36FXFX7xg5V6KEbSJ4dpQuhkLyfD", (string)a.Id);
            string s = "Qmf412jQZiuVUtdgnB36FXFX7xg5V6KEbSJ4dpQuhkLyfD";
            var text = await ipfs.FileSystem.ReadAllTextAsync((Cid)s);
       */
            List<test> tests = new List<test>();
            test t = new test();
            t.name = "aaa";
            t.age = 24;

            tests.Add(t);
            t = new test();
            t.name = "bbb";
            t.age = 99;
            tests.Add(t);

            var json = JsonConvert.SerializeObject(tests);

            var output = await ipfs.FileSystem.AddTextAsync(json);

            var text1 = await ipfs.FileSystem.ReadAllTextAsync((Cid)output.Id);
            /*
            var b = await ipfs.FileSystem.ListFileAsync(a.Id); 
            var json1 = JsonConvert.SerializeObject(b);
            var c = JsonConvert.DeserializeObject<FileSystemNode>(json);
            replacedert.AreEqual(b.Id, c.Id);
            replacedert.AreEqual(b.IsDirectory, c.IsDirectory);
            replacedert.AreEqual(b.Size, c.Size);
            Collectionreplacedert.AreEqual(b.Links.ToArray(), c.Links.ToArray());
            */
        }