Esempio n. 1
0
        public void PackAndUnpackSingleField()
        {
            var fields = new global::SQLiteServer.Fields.Fields();

            fields.Add(new Field("Hello", "World"));

            var pack    = fields.Pack();
            var fields2 = global::SQLiteServer.Fields.Fields.Unpack(pack);

            Assert.That(fields2.Count == 1);
        }
Esempio n. 2
0
        public void ManualCreatePackAndUnpackAndDeserializeObject()
        {
            var s1 = new TestFieldsStructure
            {
                A = "Hello",
                B = 12
            };

            var fields = new global::SQLiteServer.Fields.Fields();

            fields.Add(new Field("A", "Hello"));
            fields.Add(new Field("B", 12));

            var pack    = fields.Pack();
            var fields2 = global::SQLiteServer.Fields.Fields.Unpack(pack);
            var s2      = global::SQLiteServer.Fields.Fields.DeserializeObject <TestFieldsStructure>(fields2);

            Assert.AreEqual(s1.A, s2.A);
            Assert.AreEqual(s1.B, s2.B);
        }