public void Test_SaveTo()
 {
     var table = PrepareTable();
     var saver = new TemplateTableProtobufPackSaver<int, TestObject>();
     var stream = new MemoryStream();
     saver.SaveTo(table, stream);
     Assert.NotNull(stream.ToArray());
 }
示例#2
0
        public void Test_SaveTo()
        {
            var table  = PrepareTable();
            var saver  = new TemplateTableProtobufPackSaver <int, TestObject>();
            var stream = new MemoryStream();

            saver.SaveTo(table, stream);
            Assert.NotNull(stream.ToArray());
        }
        public void Test_Load()
        {
            var table = PrepareTable();

            var saver = new TemplateTableProtobufPackSaver<int, TestObject>();
            var stream = new MemoryStream();
            saver.SaveTo(table, stream);
            stream.Seek(0, SeekOrigin.Begin);

            var loader = new TemplateTableProtobufPackLoader<int, TestObject>(stream, false);
            var table2 = new TemplateTable<int, TestObject>();
            table2.Load(loader);

            Assert.Equal(table.Count, table2.Count);
            Assert.Equal(table[1].Name, table2[1].Name);
        }
示例#4
0
        public void Test_Load()
        {
            var table = PrepareTable();

            var saver  = new TemplateTableProtobufPackSaver <int, TestObject>();
            var stream = new MemoryStream();

            saver.SaveTo(table, stream);
            stream.Seek(0, SeekOrigin.Begin);

            var loader = new TemplateTableProtobufPackLoader <int, TestObject>(stream, false);
            var table2 = new TemplateTable <int, TestObject>();

            table2.Load(loader);

            Assert.Equal(table.Count, table2.Count);
            Assert.Equal(table[1].Name, table2[1].Name);
        }