GetRegularPropertyNames() public method

Gets the regular property names.
The is null.
public GetRegularPropertyNames ( Type type ) : HashSet
type System.Type Type of the model.
return HashSet
Exemplo n.º 1
0
        /// <summary>
        /// Gets the member group.
        /// </summary>
        /// <param name="modelType">Type of the model.</param>
        /// <param name="memberName">Name of the member.</param>
        /// <returns>The <see cref="SerializationMemberGroup"/>.</returns>
        protected SerializationMemberGroup GetMemberGroup(Type modelType, string memberName)
        {
            var catelProperties = SerializationManager.GetCatelPropertyNames(modelType);

            if (catelProperties.Contains(memberName))
            {
                return(SerializationMemberGroup.CatelProperty);
            }

            var regularProperties = SerializationManager.GetRegularPropertyNames(modelType);

            if (regularProperties.Contains(memberName))
            {
                return(SerializationMemberGroup.RegularProperty);
            }

            return(SerializationMemberGroup.Field);
        }
Exemplo n.º 2
0
            public void ReturnsCorrectValue()
            {
                var serializationManager = new SerializationManager();

                var properties = serializationManager.GetRegularPropertyNames(typeof(TestModel)).ToArray();

                Assert.AreEqual(1, properties.Length);
                Assert.AreEqual("IncludedRegularProperty", properties[0]);
            }
Exemplo n.º 3
0
            public void ThrowsArgumentNullExceptionForNullType()
            {
                var serializationManager = new SerializationManager();

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