示例#1
0
        public void ApplyToTreLevelByLevel_TakesAnAction_AppliesItToAllNodes()
        {
            float count = 0;

            TreeVisitor.ApplyToTreeLevelByLevel(_tree, node => count += node.Sum(n => n.Space.Width));
            Assert.That(count, Is.EqualTo(31));
        }
示例#2
0
 public void ApplyToTreeLevelByLevel_NullArgs_ThrowsError()
 {
     Assert.That(() => TreeVisitor.ApplyToTreeLevelByLevel(null !, tree => { }),
                 Throws.ArgumentNullException);
     Assert.That(() => TreeVisitor.ApplyToTreeLevelByLevel(new Widget(RectangleF.Empty), null !),
                 Throws.ArgumentNullException);
 }