/// <summary> /// Warms up the specified type. /// </summary> /// <param name="type">The type to warmup.</param> protected override void Warmup(Type type) { if (type == null) { return; } var fieldsToSerialize = SerializationManager.GetFieldsToSerialize(type); foreach (var fieldToSerialize in fieldsToSerialize) { WarmupMember(type, fieldToSerialize.Key, MemberType.Field); } var catelPropertiesToSerialize = SerializationManager.GetCatelPropertiesToSerialize(type); foreach (var propertyToSerialize in catelPropertiesToSerialize) { WarmupMember(type, propertyToSerialize.Key, MemberType.Property); } var regularPropertiesToSerialize = SerializationManager.GetRegularPropertiesToSerialize(type); foreach (var propertyToSerialize in regularPropertiesToSerialize) { WarmupMember(type, propertyToSerialize.Key, MemberType.Property); } }
public void ReturnsCorrectProperties() { var serializationManager = new SerializationManager(); var propertiesToSerialize = serializationManager.GetCatelPropertiesToSerialize(typeof(TestModel)).ToArray(); Assert.AreEqual(1, propertiesToSerialize.Length); Assert.AreEqual("IncludedCatelProperty", propertiesToSerialize[0].Key); }
public void ThrowsArgumentNullExceptionForNullType() { var serializationManager = new SerializationManager(); ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => serializationManager.GetCatelPropertiesToSerialize(null)); }