///<summary> /// This method returns a string that represents the given Class Type. ///</summary> ///<param name="classType">The class's Type object.</param> ///<returns>A string representing the Class Type.</returns> ///<param name="includeNamespace">Should the TypeId include the namespace or not</param> private static string GetTypeId(Type classType, bool includeNamespace) { string assemblyName; string className; TypeLoader.ClassTypeInfo(classType, out assemblyName, out className); return(GetTypeId(assemblyName, className, includeNamespace)); }
/// <summary> /// Constructor that creates a FilterPropertyDef class with a specified Filter control type using a type parameter. /// </summary> /// <param name="propertyName">See <see cref="PropertyName"/></param> /// <param name="label">See <see cref="Label"/></param> /// <param name="filterType"> The <see cref="Type"/> object that will determine the values of the <see cref="FilterType"/> and the <see cref="FilterTypeAssembly"/> properties.</param> /// <param name="filterClauseOperator">See <see cref="FilterClauseOperator"/></param> /// <param name="parameters">See <see cref="Parameters"/></param> public FilterPropertyDef(string propertyName, string label, Type filterType, FilterClauseOperator filterClauseOperator, Dictionary <string, string> parameters) { PropertyName = propertyName; Label = label; string assemblyName; string classNameFull; TypeLoader.ClassTypeInfo(filterType, out assemblyName, out classNameFull); FilterType = classNameFull; FilterTypeAssembly = assemblyName; FilterClauseOperator = filterClauseOperator; Parameters = parameters; }
public void Test_Constructor_WithTypeParameters() { //---------------Set up test pack------------------- string propName = TestUtil.GetRandomString(); string label = TestUtil.GetRandomString(); Dictionary <string, string> parameters = new Dictionary <string, string>(); FilterClauseOperator filterClauseOperator = TestUtil.GetRandomEnum <FilterClauseOperator>(); Type filterType = typeof(MyFilterType); //---------------Assert PreConditions--------------- //---------------Execute Test ---------------------- FilterPropertyDef def = new FilterPropertyDef(propName, label, filterType, filterClauseOperator, parameters); //---------------Test Result ----------------------- Assert.AreEqual(propName, def.PropertyName); Assert.AreEqual(label, def.Label); string assemblyName; string classNameFull; TypeLoader.ClassTypeInfo(filterType, out assemblyName, out classNameFull); Assert.AreEqual(classNameFull, def.FilterType); Assert.AreEqual(assemblyName, def.FilterTypeAssembly); Assert.AreSame(parameters, def.Parameters); Assert.AreEqual(filterClauseOperator, def.FilterClauseOperator); }