Пример #1
0
        public void ToBufferTest1()
        {
            Guid            id       = Guid.NewGuid();
            TestPackageData package1 = new TestPackageData();

            Serializer ser = new Regulus.Serialization.Serializer(new DescriberBuilder(typeof(Guid), typeof(TestPackageData)).Describers);

            package1.Id = id;

            byte[] buffer = package1.ToBuffer(ser);

            TestPackageData package2 = buffer.ToPackageData <TestPackageData>(ser);

            Xunit.Assert.Equal(id, package2.Id);
        }
Пример #2
0
        public void ToBufferTest1()
        {
            var id       = Guid.NewGuid();
            var package1 = new TestPackageData();

            var ser = new Regulus.Serialization.Serializer(new DescriberBuilder(typeof(Guid), typeof(TestPackageData)).Describers);

            package1.Id = id;

            var buffer = package1.ToBuffer(ser);

            var package2 = buffer.ToPackageData <TestPackageData>(ser);

            NUnit.Framework.Assert.AreEqual(id, package2.Id);
        }