by Paul Kohler via PK Software (OLD Blog) - see http://www.pksoftware.net/devblog/ on 3/20/2007 12:32:20 PM
My blog has moved to: http://www.pksoftware.net/devblog/
This post now at: http://www.pksoftware.net/devblog/post/2007/03/Working-With-Unsupported-Controls-In-NUnitForms.aspx
Another sequel to the entry on "Getting Started with NUnitForms" http://www.pksoftware.net/blog/2007/02/06/Getting+Started+With+NUnitForms.aspx This post is focused on compiling the latest NUnitForms code from sourceforge. I have seen/heard/had a few questions about testing windows forms controls that are not currently supported by NUnitForms (specifically ".Net 2.0 NUnitForms alpha 5 release" - http://sourceforge.net/project/showfiles.php?group_id=95656). There are 2 answers...
public class PictureBoxTester : ControlTester<PictureBox, PictureBoxTester> { // Now implement each overloaded constructor calling the base class public PictureBoxTester() {} public PictureBoxTester(string name, Form form) : base(name, form) {} public PictureBoxTester(string name, string formName) : base(name, formName) {} public PictureBoxTester(string name) : base(name) {} public PictureBoxTester(ControlTester tester, int index) : base(tester, index) {} }
[Test] public void ExamplePropertyCheckAndDoubleClickTest() { PictureBoxTester picTester = new PictureBoxTester("pictureBox1"); Assert.AreEqual(@"C:\dir\somePic.bmp", picTester.Properties.ImageLocation); picTester.DoubleClick(); }
Original Post: Working with unsupported controls in NUnitForms
The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.