-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Unit Tests to use DataRow #186
Conversation
- Migrate UnitTestFormat. - Update test framework sub-module.
@torbacz I couldn't resist and I've started the migration of the Unit Tests to use the shiny new DataRow 😉 The thing is that it's failing... Care to take a look please? |
@josesimoes |
@josesimoes Also I found out 2 more issues:
On Monday I'm going to create all 3 issues and try to resolve the first one (which is most important for now) |
OK... I'm not looking at the code right now so I have little advice to offer at this time. Maybe we can switch the separator from a comma to another char less likely to be found im those contexts like a pipe | or an asterisk * or a #. |
|
||
[TestMethod] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove [TestMethod] parameter when using [DataRow] :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 maybe I could... but I don't think we should... Check here please.
The official usage guidance calls for both. I get it that we may handle this differently but then we have to take care of it internally so it doesn't break the official usage.
Maybe process DataRow before TestMethod and then don't call it "a second time" or make a mutually exclusive check... not sure what would be more efficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With current implementation of DataRow - it will probably fail. Test framework will try to invoke method and pass "null" as parameters.
" mutually exclusive check" - do you mean something like this:
if (testMethod.Contains(DataRowAttribute) && test.Method.Contains(TestMethodAttrubite)
{
throw Exception();
}
Or just ignore TestMethod attribute when there is DataRow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would go with the latter. Test will be executed (as intended) just that with the correct context (using DataRow(s)). And the "doomed to fail" execution of TestMethod is skipped.
@josesimoes
Output from console:
Note: Additional spaces and : |
Not that I'm aware of... 😯 unit test have been passing in mscorlib. |
Found it, when coping from github it removed 2 spaces from parameters.... PR for new version of test framework on the way - resolving ',' in parameters, long strings in parameters and skipping "TestMethod" if "DataRow" is used. |
@josesimoes |
@torbacz brilliant! Thank you very much for the quick turn around. |
@josesimoes
|
I've change only 2 things in your code:
|
@torbacz I had to wait for you to join the organization before assigning the permissions. You can now push that branch. |
@josesimoes
|
Please DO NOT change that otherwise it wont' work! 😱 |
@torbacz it should allow you to push now. |
@josesimoes Btw "Do not change that" - do not change to package or do not update submodule to latest? |
Odd... Please go for a PR against that branch instead. |
OK to update sub-module. |
@torbacz I'm thinking that it will take a while to complete the migration to DataRow (considering the lack of participation from the community). Therefore I suggest that this is merged as it is and the work can be resumed in future iterations. |
Ok! Maybe create an issue for it? |
Good idea! It will add visibility to the task. Care to do add it and link it back to this PR? |
Description
Motivation and Context
How Has This Been Tested?
Screenshots
Types of changes
Checklist: