Esempio n. 1
0
        /// <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);
            }
        }
Esempio n. 2
0
            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);
            }
Esempio n. 3
0
            public void ThrowsArgumentNullExceptionForNullType()
            {
                var serializationManager = new SerializationManager();

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => serializationManager.GetCatelPropertiesToSerialize(null));
            }