public void TestEmptyArrays()
        {
            Tst t = new Tst();

            t.ValInt    = 128;
            t.Str1      = "SOme string text value ttt";
            t.ArrayData = new byte[] { };

            MemoryStream stm = new MemoryStream();

            Serializer.Serialize(stm, t);
            Console.WriteLine(stm.Length);
        }
Esempio n. 2
0
        public void SmokeTest()
        {
            var trie = new Tst <int>();

            trie.Put("one", 1);
            trie.Put("two", 2);
            trie.Put("three", 3);
            trie.Put("four", 4);
            trie.Put("five", 5);

            Assert.AreEqual(1, trie.Get("one"));
            Assert.AreEqual(2, trie.Get("two"));
            Assert.AreEqual(3, trie.Get("three"));
            Assert.AreEqual(4, trie.Get("four"));
            Assert.AreEqual(5, trie.Get("five"));

            Assert.False(trie.Contains("six"));
        }
Esempio n. 3
0
    static void Main(string[] args)
    {
        var serializer = new XmlSerializer(typeof(Tst));
        var arr        = new Tst[]
        {
            new Tst {
                A = "s1"
            },
            new Tst {
                A = "s2"
            },
        };

        using (var stream = new MemoryStream())
        {
            using (var archive = new System.IO.Compression.ZipArchive(stream, ZipArchiveMode.Create, true))
            {
                for (int i = 0; i < arr.Length; i++)
                {
                    var documentName = "def.xml";
                    if (i == 0)
                    {
                        documentName = "commonInformation.xml";
                    }
                    if (i == 1)
                    {
                        documentName = "contactInformation.xml";
                    }
                    var entry = archive.CreateEntry(documentName, CompressionLevel.NoCompression);
                    using (var writer = new StreamWriter(entry.Open()))
                    {
                        serializer.Serialize(writer, arr[i]);
                    }
                }
            }
        }
    }
Esempio n. 4
0
        public void TestEmptyArrays()
        {
            Tst t = new Tst();
            t.ValInt = 128;
            t.Str1 = "SOme string text value ttt";
            t.ArrayData = new byte[] { };

            MemoryStream stm = new MemoryStream();
            Serializer.Serialize(stm, t);
            Console.WriteLine(stm.Length);
        }
Esempio n. 5
0
        public void TestDateTime()
        {
            var t = Tst.Find(p => p.Dt <= DateTime.Now);

            Assert.AreEqual(2, t.Count);
        }
Esempio n. 6
0
 public void TestDateTime()
 {
     var t = Tst.Find(p => p.Dt <= DateTime.Now);
 }