public void TestAddDataSerializableFactoryClassWithNoEmptyConstructor() { var config = new SerializationConfig(); config.AddDataSerializableFactoryClass(1, typeof(SerializableFactory)); var service = new SerializationServiceBuilder().SetConfig(config).Build(); }
public void TestAddDataSerializableFactoryClassWithBadId() { var config = new SerializationConfig(); config.AddDataSerializableFactoryClass(-1, typeof(MyDataSerializableFactory)); var service = new SerializationServiceBuilder().SetConfig(config).Build(); }
public void TestAddDataSerializableFactoryClassWithNoEmptyConstructor() { Assert.Throws <HazelcastSerializationException>(() => { var config = new SerializationConfig(); config.AddDataSerializableFactoryClass(1, typeof(SerializableFactory)); var service = new SerializationServiceBuilder().SetConfig(config).Build(); }); }
public void TestAddDataSerializableFactoryClassWithBadId() { Assert.Throws <ArgumentException>(() => { var config = new SerializationConfig(); config.AddDataSerializableFactoryClass(-1, typeof(MyDataSerializableFactory)); var service = new SerializationServiceBuilder().SetConfig(config).Build(); }); }
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); }