public void calculateTableLocationCenteredInContainerTest() { UIAritmetics uiAritmetics = new UIAritmetics(); System.Drawing.Size tableSize = new System.Drawing.Size(50, 50); System.Drawing.Size containerSize = new System.Drawing.Size(100, 100); System.Drawing.Point tableLocation = uiAritmetics.calculateTableLocationCenteredInContainer(tableSize, containerSize); Assert.AreEqual(25, tableLocation.X); }
// ----------------------------- // Public methods // ----------------------------- public MainForm() { //InitializeComponent(); // Initialize helpers this.uiAritmetics = new UIAritmetics(); // Generate first screen (including table) this.createBasicLayout(); this.createDynamicTable(); this.setLayout(); }
public void calculateClientSizeSmallerTableTest() { UIAritmetics uiAritmetics = new UIAritmetics(); System.Drawing.Size tableSize = new System.Drawing.Size(100, 100); System.Drawing.Size menuStripSize = new System.Drawing.Size(100, 15); int cellHeight = 10; int cellWidth = 10; System.Drawing.Size button1Size = new System.Drawing.Size(45, 15); System.Drawing.Size button2Size = new System.Drawing.Size(45, 15); System.Drawing.Size clientSize = uiAritmetics.calculateClientSize(tableSize, menuStripSize, cellHeight, cellWidth, button1Size, button2Size); Assert.AreEqual(150, clientSize.Width); }