Exemple #1
0
        /// <summary>
        /// Checks if a dynamic type can be set in a new DataList and if the returned DataList is the same (so it can be used in subsequent fluent calls).
        /// </summary>
        public void SetDynamicTypeOfDataList()
        {
            String personData = String.Format("{0}Data", typeof(Person).FullName);

            IQueryableList<Person> queryableList = new DataList<Person>();
            IQueryableList<Person> fluentList = queryableList.OfDynamicType(personData);

            Assert.True(ReferenceEquals(queryableList, fluentList), "The returned object isn't the same after assigning the dynamic type.");
            Assert.True(fluentList.GetType().GetTypeInfo().BaseType.GetTypeInfo().GetDeclaredField("dynamicType").GetValue(fluentList).ToString() == personData, "The returned object doesn't contain the correct dynamic type.");
        }