コード例 #1
0
        public void AppWireSerializerTest003_SerializeCustomerAppEvent_ExpectNoExceptions()
        {
            var sz = new AppWireSerializer <AppEventArgs <Customer> >();

            Customer entity = new Customer("CustomerMasterRepositoryTest001_cname", "1-800-start");

            AppEventArgs <Customer> evt = new AppEventArgs <Customer>()
            {
                beforeChange = new Customer(),
                afterChange  = entity,
                appEventType = AppEventType.Insert
            };

            this.testLogger.LogDebug($"*** Original:\n{entity.ToJson()}");

            sz.Serialize(evt);
            var serialized = sz.GetSerializedData();

            sz.Reset();
            var reconstructed = sz.Deserialize(serialized);

            this.testLogger.LogDebug($"*** Deserialized:\n{reconstructed.ToJson()}");

            Assert.Equal(evt.id, reconstructed.id);
        }
コード例 #2
0
        public void AppWireSerializerTest001_SerializeCustomer_ExpectNoExceptions()
        {
            var sz = new AppWireSerializer <Customer>();

            Customer entity = new Customer("CustomerMasterRepositoryTest001_cname", "1-800-start");

            this.testLogger.LogDebug($"*** Original:\n{entity.ToJson()}");

            sz.Serialize(entity);

            sz.Reset();
            var reconstructed = sz.Deserialize();

            this.testLogger.LogDebug($"*** Deserialized:\n{reconstructed.ToJson()}");

            // Assert.Equal(entity, reconstructed);
        }