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)); }
private static void AssertTypeIsRegistered(Type type) { Assert.That(TypeInfoRepository.GetTypeInfo(type).ShortTypeId, Is.Not.Null, type.FullName + " is not registered as predefined type!"); }
public static Func <BinaryReader, object> GetDeserializer(string typeFullName) { return(TypeInfoRepository.GetTypeInfo(typeFullName).Deserializer); }
public static Action <BinaryWriter, object> GetSerializer(Type type) { return(TypeInfoRepository.GetTypeInfo(type).Serializer); }