def testDragDropFiles(self): form = MainForm() fileNames = ["images\\andrzej.jpg", "images\\michael.jpg"] event = Event(containsFiles=True, files=fileNames) form.onDragDrop(None, event) assertTabPages(form, 2)
def testFreshFormOpensFiles(self): openFileDialog=MockOpenFileDialog( DialogResult = DialogResult.OK, FileNames = ["images\\andrzej.jpg", "images\\michael.jpg"]) form = MainForm(openFileDialog) form.onOpen(None, None) assertTabPages(form, 2)
def testDragFilesEffect(self): form = MainForm() event = Event(containsFiles = True) form.onDragEnter(None, event) assert event.Effect == DragDropEffects.Copy
def testDragNonFilesEffect(self): form = MainForm() assert form.AllowDrop event = Event(containsFiles=False) form.onDragEnter(None, event) assert event.Effect == DragDropEffects.None
def testFreshFormOpensFilesCancelledHasEmptyTabControl(self): openFileDialog=MockOpenFileDialog( DialogResult = DialogResult.Cancel) form = MainForm(openFileDialog) form.onOpen(None, None) assertTabPages(form, 0)