Exemple #1
0
 public void ShouldRegisterAllSerializableTypesFromAssemblyInProperOrder()
 {
     TypeInfoRepository.RegisterPredefinedUsingSerializableFrom(GetType().Assembly);
     AssertRegistrationFor(typeof(SerializableType));
     AssertRegistrationFor(typeof(InternalSerializableType));
     Assert.That(
         TypeInfoRepository.GetTypeInfo(typeof(InternalSerializableType)).ShortTypeId,
         Is.LessThan(TypeInfoRepository.GetTypeInfo(typeof(SerializableType)).ShortTypeId));
 }
Exemple #2
0
 private static void AssertTypeIsRegistered(Type type)
 {
     Assert.That(TypeInfoRepository.GetTypeInfo(type).ShortTypeId, Is.Not.Null, type.FullName + " is not registered as predefined type!");
 }
Exemple #3
0
 public static Func <BinaryReader, object> GetDeserializer(string typeFullName)
 {
     return(TypeInfoRepository.GetTypeInfo(typeFullName).Deserializer);
 }
Exemple #4
0
 public static Action <BinaryWriter, object> GetSerializer(Type type)
 {
     return(TypeInfoRepository.GetTypeInfo(type).Serializer);
 }