예제 #1
0
        public void TestBoNames()
        {
            HashSet <string> testResult = BoMapper.GetValidBoNames();

            Assert.IsTrue(testResult.Contains("Messlokation"));
            Assert.IsTrue(testResult.Contains("Energiemenge"));
            Assert.IsFalse(testResult.Contains("Verbrauch"), "No COM");
            Assert.IsFalse(testResult.Contains("CompletenessReport")); // has moved to extensions
            Assert.IsFalse(testResult.Contains("Mengeneinheit"), "No enums");
        }
예제 #2
0
 /// <summary>
 /// Get name of business object with correct upper/lower case (the host value)
 /// </summary>
 /// <returns>business object name or null iff there is no such object</returns>
 public string GetBoName()
 {
     foreach (string boName in BoMapper.GetValidBoNames())
     {
         if (boName.ToUpper().Equals(this.Host.ToUpper()))
         {
             return(boName);
         }
     }
     return(null);
 }
예제 #3
0
        /// <summary>
        /// Get name of business object with correct upper/lower case (the host value)
        /// </summary>
        /// <returns>business object name or null iff there is no such object</returns>
        public string GetBoName()
        {
#pragma warning disable CS0618 // Type or member is obsolete
            foreach (string boName in BoMapper.GetValidBoNames())
#pragma warning restore CS0618 // Type or member is obsolete
            {
                if (boName.ToUpper().Equals(this.Host.ToUpper()))
                {
                    return(boName);
                }
            }
            return(null);
        }
예제 #4
0
        /// <summary>
        /// <see cref="GetExpandablePropertyNames(Type)"/>
        /// </summary>
        /// <param name="boTypeName">name of the business object as string</param>
        /// <returns><see cref="GetExpandablePropertyNames(Type)"/></returns>
        public static Dictionary <string, Type> GetExpandableFieldNames(string boTypeName)
        {
            Type clazz = Assembly.GetExecutingAssembly().GetType(BoMapper.packagePrefix + "." + boTypeName);

            if (clazz == null)
            {
                throw new ArgumentException($"{boTypeName} is not a valid Business Object name. Use one of the following: {string.Join("\n -", BoMapper.GetValidBoNames())}");
            }
            return(GetExpandablePropertyNames(clazz));
        }