public void Test_GetClusterKey_NonConvertibleValue() {
     FlagClusteringStrategy strategy = new FlagClusteringStrategy(typeof(TestFlagEnum));
     strategy.Column = new OLVColumn();
     strategy.Column.AspectGetter = delegate(object x) { return new object(); };
     object result = strategy.GetClusterKey(null);
     Assert.IsInstanceOf<IEnumerable>(result);
     Assert.AreEqual(0, ((ICollection)result).Count);
 }
 public void Test_GetClusterKey() {
     FlagClusteringStrategy strategy = new FlagClusteringStrategy(typeof(TestFlagEnum));
     strategy.Column = new OLVColumn();
     strategy.Column.AspectGetter = delegate(object x) { return TestFlagEnum.FlagValue1 | TestFlagEnum.FlagValue4; };
     object result = strategy.GetClusterKey(null);
     Assert.IsInstanceOf<IEnumerable>(result);
     Assert.AreEqual(2, ((ICollection)result).Count);
     Assert.Contains((ulong)TestFlagEnum.FlagValue1, result as ICollection);
     Assert.Contains((ulong)TestFlagEnum.FlagValue4, result as ICollection);
 }
Пример #3
0
        public void Test_GetClusterKey_NonConvertibleValue()
        {
            FlagClusteringStrategy strategy = new FlagClusteringStrategy(typeof(TestFlagEnum));

            strategy.Column = new OLVColumn();
            strategy.Column.AspectGetter = delegate(object x) { return(new object()); };
            object result = strategy.GetClusterKey(null);

            Assert.IsInstanceOf <IEnumerable>(result);
            Assert.AreEqual(0, ((ICollection)result).Count);
        }
Пример #4
0
        public void Test_GetClusterKey()
        {
            FlagClusteringStrategy strategy = new FlagClusteringStrategy(typeof(TestFlagEnum));

            strategy.Column = new OLVColumn();
            strategy.Column.AspectGetter = delegate(object x) { return(TestFlagEnum.FlagValue1 | TestFlagEnum.FlagValue4); };
            object result = strategy.GetClusterKey(null);

            Assert.IsInstanceOf <IEnumerable>(result);
            Assert.AreEqual(2, ((ICollection)result).Count);
            Assert.Contains((ulong)TestFlagEnum.FlagValue1, result as ICollection);
            Assert.Contains((ulong)TestFlagEnum.FlagValue4, result as ICollection);
        }