UnitTestBoilerplateGenerator
UnitTestBoilerplateGenerator copied to clipboard
using System.Drawing; was not added as one of the auto generated using statements
Installed product versions
- Visual Studio: [example 2017 Professional]
- This extension: [example 2.7.0]
Description
When I created boiler plate unit test, the using statement did not get added and I had to add in myself. using System.Drawing;
Steps to recreate
-
Add this to code var newLabel = new DevExpress.XtraEditors.LabelControl { Text = name, Width = 150, Font = font, AutoSizeMode = LabelAutoSizeMode.Vertical, AutoSize = true, Dock = DockStyle.Left, };
-
Create a Unit test
-
Font has red squiggle because using statement is missing.
Current behavior
using statement is missing because system.drawing is not referenced
Expected behavior
using System.Drawing; is included in the unit test file and Font doesn't have a missing reference.
Did you put System.Drawing in the Extra "using" namespaces field in Options?

No... I didn't see that field. I was under the impression that it would include all of the using's from the code file. Maybe that should be a feature request?
Maybe? Many times, you don't actually want all of the using statements that the source file has. I'll consider it as an option.
But you can always remove them later. I'd rather have too many and delete the extra's than have to hunt down what is missing, personally.
Also, not all the 'usings' that I add to the 'Extra "using" namespaces are going to be needed for all my files, so I'm adding 'usings' that I don't need in that case.
There are a LOT of using statements in the code file with which I'm working. I'd rather not have to add them all to this field.
Yeah that field is really more for if you included some extra test library that was always used in the template. It's a reasonable feature request. Might be a while until I can get to it as I'm busy with some other projects, but I'm always accepting PRs.