Ejemplo n.º 1
0
        /// <summary>Returns true if a given feature is supported in the given layout version
        ///     </summary>
        /// <param name="map">layout feature map</param>
        /// <param name="f">Feature</param>
        /// <param name="lv">LayoutVersion</param>
        /// <returns>
        /// true if
        /// <paramref name="f"/>
        /// is supported in layout version
        /// <paramref name="lv"/>
        /// </returns>
        public static bool Supports(IDictionary <int, ICollection <LayoutVersion.LayoutFeature
                                                                   > > map, LayoutVersion.LayoutFeature f, int lv)
        {
            ICollection <LayoutVersion.LayoutFeature> set = map[lv];

            return(set != null && set.Contains(f));
        }
Ejemplo n.º 2
0
 public virtual void TestDataNodeFeature()
 {
     LayoutVersion.LayoutFeature first = DataNodeLayoutVersion.Feature.FirstLayout;
     NUnit.Framework.Assert.IsTrue(DataNodeLayoutVersion.Supports(LastNonReservedCommonFeature
                                                                  , first.GetInfo().GetLayoutVersion()));
     NUnit.Framework.Assert.AreEqual(LastCommonFeature.GetInfo().GetLayoutVersion() -
                                     1, first.GetInfo().GetLayoutVersion());
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Given feature
        /// <paramref name="f"/>
        /// , ensures the layout version of that feature
        /// supports all the features supported by it's ancestor.
        /// </summary>
        private void ValidateFeatureList(LayoutVersion.LayoutFeature f)
        {
            LayoutVersion.FeatureInfo info = f.GetInfo();
            int lv         = info.GetLayoutVersion();
            int ancestorLV = info.GetAncestorLayoutVersion();
            ICollection <LayoutVersion.LayoutFeature> ancestorSet = NameNodeLayoutVersion.GetFeatures
                                                                        (ancestorLV);

            NUnit.Framework.Assert.IsNotNull(ancestorSet);
            foreach (LayoutVersion.LayoutFeature feature in ancestorSet)
            {
                NUnit.Framework.Assert.IsTrue("LV " + lv + " does nto support " + feature + " supported by the ancestor LV "
                                              + info.GetAncestorLayoutVersion(), NameNodeLayoutVersion.Supports(feature, lv));
            }
        }
Ejemplo n.º 4
0
 public static bool Supports(LayoutVersion.LayoutFeature f, int lv)
 {
     return(LayoutVersion.Supports(Features, f, lv));
 }
Ejemplo n.º 5
0
 static TestLayoutVersion()
 {
     LayoutVersion.Feature[] features = LayoutVersion.Feature.Values();
     LastCommonFeature            = features[features.Length - 1];
     LastNonReservedCommonFeature = LayoutVersion.GetLastNonReservedFeature(features);
 }