Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
public partial class ImportForm : Form{ public ImportForm() { } public bool Test(string[] fileNames)//Method to test { return true; } }
[TestMethod] public void TestTest() { bool results=false; var files = new string[4]; files[0] = @"filename1.xlsx"; files[1] = @"filename2.xlsx"; ImportForm form= new ImportForm(); results = form.Test(files); Assert.AreEqual(true, results); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)