Skip to content
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

Reading traits/properties from xml test-run tree using cache #406

Merged
merged 17 commits into from
Oct 16, 2017

Conversation

OsirisTerje
Copy link
Member

@OsirisTerje OsirisTerje commented Oct 7, 2017

See #392 and PR #401

@CharliePoole
Copy link
Member

I see you are using the word attributes in several places although the code had nothing to do with attributes. The adapter gets properties from NUnit and creates traits. Some properties (not all) correspond to NUnit attributes but the adapter doesn't know that.

@OsirisTerje
Copy link
Member Author

Based on this line:
_attributesCache = new Dictionary<string, List>();
a better name could be _traitsCache, since the content are a keyed dictionary of traits.
Agree?

@OsirisTerje
Copy link
Member Author

All tests I have thought of have now been added and are green. I have also tested this with comparison to the current adapter on different test code scenarios, and it returns the same.

@CharliePoole
Copy link
Member

Yes, as well as the property.

@@ -41,24 +40,81 @@ public static void AddTrait(this TestCase testCase, string name, string value)
}
}

public static void AddTraitsFromTestNode(this TestCase testCase, XmlNode test)
public static void AddTraitsFromTestNode(this TestCase testCase, XmlNode testNode, IDictionary<string,List<Trait>> propertiesCache)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit : should we change the naming convention here also to traitsCache instead of propertiesCache.

return string.IsNullOrEmpty(propertyName) || propertyName[0] == '_' || string.IsNullOrEmpty(propertyValue);
}

private static void AddTraitsToCache(IDictionary<string, List<Trait>> propertiesCache, string key, string propertyName, string propertyValue)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: same as above.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

@OsirisTerje OsirisTerje merged commit 4cd1e91 into master Oct 16, 2017
@OsirisTerje OsirisTerje deleted the dev-392 branch October 16, 2017 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants