예제 #1
0
        public void TestAddDataSerializableFactoryClassWithNoEmptyConstructor()
        {
            var config = new SerializationConfig();

            config.AddDataSerializableFactoryClass(1, typeof(SerializableFactory));
            var service = new SerializationServiceBuilder().SetConfig(config).Build();
        }
예제 #2
0
        public void TestAddDataSerializableFactoryClassWithBadId()
        {
            var config = new SerializationConfig();

            config.AddDataSerializableFactoryClass(-1, typeof(MyDataSerializableFactory));
            var service = new SerializationServiceBuilder().SetConfig(config).Build();
        }
예제 #3
0
 public void TestAddDataSerializableFactoryClassWithNoEmptyConstructor()
 {
     Assert.Throws <HazelcastSerializationException>(() =>
     {
         var config = new SerializationConfig();
         config.AddDataSerializableFactoryClass(1, typeof(SerializableFactory));
         var service = new SerializationServiceBuilder().SetConfig(config).Build();
     });
 }
예제 #4
0
 public void TestAddDataSerializableFactoryClassWithBadId()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         var config = new SerializationConfig();
         config.AddDataSerializableFactoryClass(-1, typeof(MyDataSerializableFactory));
         var service = new SerializationServiceBuilder().SetConfig(config).Build();
     });
 }
예제 #5
0
        public void TestAddDataSerializableFactoryClass()
        {
            var service1 = new SerializationServiceBuilder().Build();
            var data     = service1.ToData(new DataSerializableBasicType());

            var config = new SerializationConfig();

            config.AddDataSerializableFactoryClass(1, typeof(MyDataSerializableFactory));
            var service = new SerializationServiceBuilder().SetConfig(config).Build();

            var obj = service.ToObject <object>(data);

            Assert.IsInstanceOf <DataSerializableBasicType>(obj);
        }