Ejemplo n.º 1
0
        public void AddInEmptyCache()
        {
            var expected = 43.0;
            var target = new SizesCache();
            target.AddOrChange(0, expected);

            Assert.AreEqual(expected, target.GetEstimate(0));
        }
Ejemplo n.º 2
0
        public void AddInFilledCache()
        {
            var target = new SizesCache();
            target.AddOrChange(0, 43);
            target.AddOrChange(0, 46);
            target.AddOrChange(0, 46);

            Assert.AreEqual(46, target.GetEstimate(0));
        }
Ejemplo n.º 3
0
        public void CleanUpFilledCacheNormalCase()
        {
            var target = new SizesCache();
            target.AddOrChange(0, 40);
            target.AddOrChange(0, 41);
            target.AddOrChange(0, 42);
            target.AddOrChange(0, 43);

            target.CleanUp(0);
            Assert.AreEqual(0, target.GetEstimate(0));
        }
Ejemplo n.º 4
0
        public void ChangeWithMaxItems()
        {
            var target = new SizesCache();
            target.AddOrChange(0, 1);
            target.AddOrChange(0, 1);
            target.AddOrChange(0, 3);
            target.AddOrChange(0, 3);
            target.AddOrChange(0, 5);
            target.AddOrChange(0, 7);
            target.AddOrChange(0, 7);
            target.AddOrChange(0, 9);
            target.AddOrChange(0, 9);
            target.AddOrChange(0, 11);
            target.AddOrChange(0, 11);
            target.AddOrChange(0, 11);

            Assert.AreEqual(11, target.GetEstimate(0));
        }
Ejemplo n.º 5
0
 public VirtualizingTreePanel()
 {
     cachedSizes = new SizesCache();
     CanHorizontallyScroll = true;
     CanVerticallyScroll = true;
 }
 public VirtualizingTreePanel()
 {
     cachedSizes = new SizesCache();
     CanHorizontallyScroll = true;
     CanVerticallyScroll = true;
 }
Ejemplo n.º 7
0
 public void CleanUpEmptyCache()
 {
     var target = new SizesCache();
     target.Invoking(x => x.CleanUp(0)).ShouldNotThrow();
 }