Inheritance: Open.Core.UI.Controls.ToolBase
 public void TestSetup()
 {
     tool = new MockTool();
 }
        public void ShouldNotGetDeepChildTool()
        {
            var tool = new MockTool { Id = MyEnum.One };
            var toolGroup = toolbar.AddToolGroup();
            toolGroup.Add(tool);

            toolbar.GetTool(MyEnum.One, includeChildToolbars: false).ShouldBe(null);
            toolbar.GetTool(MyEnum.Two, includeChildToolbars: false).ShouldBe(null);
        }
        public void ShouldNotGetTool()
        {
            var tool = new MockTool { Id = "MyId" };
            toolbar.Add(tool);
            toolbar.GetTool("MyId2").ShouldBe(null);

            toolbar.GetTool(null).ShouldBe(null);
            toolbar.GetTool<IButtonTool>(null).ShouldBe(null);
        }
 public void ShouldNotAllowSpanValuesToBeLessThanOne()
 {
     var tool = new MockTool();
     Should.Throw<ArgumentOutOfRangeException>(() => toolbar.Add(tool, columnSpan: 0));
     Should.Throw<ArgumentOutOfRangeException>(() => toolbar.Add(tool, rowSpan: 0));
 }
 public void ShouldGetTool()
 {
     var tool = new MockTool { Id = MyEnum.One };
     toolbar.Add(tool);
     toolbar.GetTool(MyEnum.One).ShouldBe(tool);
     toolbar.GetTool(MyEnum.Two).ShouldBe(null);
 }
        public void ShouldGetColumnAndRowDetailsForAddedTool()
        {
            var tool = new MockTool();
            toolbar.Add(tool, 1, 2, 3, 4);

            toolbar.GetColumn(tool).ShouldBe(1);
            toolbar.GetRow(tool).ShouldBe(2);
            toolbar.GetColumnSpan(tool).ShouldBe(3);
            toolbar.GetRowSpan(tool).ShouldBe(4);
        }
 public void ShouldAutoSetRowToZero()
 {
     var tool = new MockTool();
     toolbar.Add(tool);
     toolbar.GetRow(tool).ShouldBe(0);
 }
        public void ShouldAutoIncrementColumnWhenNullPassed()
        {
            var tool1 = new MockTool();
            var tool2 = new MockTool();
            toolbar.Add(tool1);
            toolbar.Add(tool2);

            toolbar.GetColumn(tool1).ShouldBe(0);
            toolbar.GetColumn(tool2).ShouldBe(1);
        }
        public void ShouldAssignToolBarAsParentWhenAdded()
        {
            var tool = new MockTool();
            tool.Parent.ShouldBe(null);

            toolbar.Add(tool);
            tool.Parent.ShouldBe(toolbar);
        }
 public void ShouldAddToolToCollection()
 {
     var tool = new MockTool();
     toolbar.Add(tool);
     toolbar.Tools.ShouldContain(tool);
 }