1
Vote

Adding two commands to an Assert crashes ssisUnitTestRunnerUI

description

I was trying to explore the abilities of the tool after following the getting started document (quite helpful btw so thank you for including it). My first thought was to try the other commands so I added a second command to an existing assertion. Apparently that's incorrect usage (no, I haven't read up on xUnit testing, it's on my TODO) but the menu allowed me to add it and then threw an uncaught error (listed below). I would expect it to either prevent me from adding more than one command or if it's allowed to catch the error and not actually add the command. Clearly not a show stopper and literate users wouldn't make that mistake so no real urgency.
 
************** Exception Text **************
System.ArgumentException: There can only be one Command for an Assert. Please delete the existing Command before adding a new one.
at ssisUnitTestRunnerUI.TestBrowser.AddCommand(String commandType)
at ssisUnitTestRunnerUI.TestBrowser.addGenericCommandToolStripMenuItem_Click(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

comments

johnwelch wrote Oct 22, 2008 at 6:44 PM

Yes, each Assert supports only a single command. I'll add a check to the UI to disable the menu item.

Thanks - appreciate the feedback.