public AbsUIElementGroup(IUIElementGroupConstArg arg) : base(arg) { thisRowCountConstraint = arg.rowCountConstraint; thisColumnCountConstraint = arg.columnCountConstraint; MakeSureArrayConstraintIsProperlySet(); CheckAndSetMaxElementsCount(); thisTopToBottom = arg.topToBottom; thisLeftToRight = arg.leftToRight; thisRowToColumn = OverrideRowToColumnAccordingToConstraint(arg.rowToColumn); thisArrayIndexCalculator = new UIElementGroupArrayIndexCalculator( thisTopToBottom, thisLeftToRight, thisRowToColumn ); }
IUIElementGroupConstArg CreateMockConstArg() { IUIElementGroupConstArg arg = Substitute.For <IUIElementGroupConstArg>(); arg.columnCountConstraint.Returns(3); arg.rowCountConstraint.Returns(0); arg.topToBottom.Returns(true); arg.leftToRight.Returns(true); arg.rowToColumn.Returns(true); arg.uim.Returns(Substitute.For <IUIManager>()); arg.processFactory.Returns(Substitute.For <IUISystemProcessFactory>()); arg.uiElementFactory.Returns(Substitute.For <IUIElementFactory>()); arg.uia.Returns(Substitute.For <IUIElementGroupAdaptor>()); arg.image.Returns(Substitute.For <IUIImage>()); return(arg); }
public void CalcNumberOfRowsToCreate_Various( int columnCountConstraint, int rowCountConstraint, int elementsCount, int expected ) { IUIElementGroupConstArg arg = CreateMockConstArg(); arg.columnCountConstraint.Returns(columnCountConstraint); arg.rowCountConstraint.Returns(rowCountConstraint); TestUIElementGroup uieGroup = new TestUIElementGroup(arg); List <IUIElement> elements = CreateUIElements(elementsCount); uieGroup.SetElements(elements); int actual = uieGroup.CalcNumberOfRowsToCreate_Test(); Assert.That(actual, Is.EqualTo(expected)); }
public GenericUIElementGroup(IUIElementGroupConstArg arg) : base(arg) { }
public TestUIElementGroup(IUIElementGroupConstArg arg) : base(arg) { }