-
Notifications
You must be signed in to change notification settings - Fork 105
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
Can't read app.config settings within test methods #17
Comments
This is confirmed. The test adapter does not set the config file location for the test domain. |
Would a fix for this also make bindingRedirect work? |
Yes, so long as it's in the config file named for the assembly being loaded. |
It's in the .exe.config for an exe using NUnitLite 3, so I think so. |
Add tests to verify that #17 is fixed; cateorize tests by expected result
This issue seems to still exist. Did something change recently that would cause it to no longer work? |
@ravensorb There are 2 tests in the NUnit Demo project for this, and they both are working. If you still have a fail, please raise a new issue with a small repro project |
Hmm, I looked at that and I don't see any test that is reading from ConfigurationManager.AppSettings -- am I missing something? Note -- these tests also fail in VS2019 |
Did you look at https://github.com/nunit/nunit3-vs-adapter-demo/blob/master/src/csharp/ConfigFileTests.cs ?
If it still doesn't work for you, can you please create a small repro and upload it ? It should work "as is". |
Ok, I was looking in the .netcore test project. Few things observed
From my side, I am switching over my code to using ConfigurationBuilder as well so I think I am good now. Thanks! |
Purpose of the test demo is for us to see how the tests appear in the IDE so done of them fail. If you display by traits, you'll see expected failures, etc. |
@ravensorb I just checked with VS 2019, and it works. Discovery is working, and so is running them. I see a couple of tests there (marked red) that has unexpected results, but I havent checked them in VS2017 yet. But all in all, this works. |
Yep that aligns for the most part with what I was seeing after I added the test runner. So that makes complete sense. For the netcore one, I could probably do a PR for the new configuationbuilder if that would be useful. |
Absolutely! Please do! |
I also noted now, that I have been a bit sloppy here, I have upgraded and added the TestAdadpter in a separate branch, and forgot to push it up and raise a PR for it. Shame on me :-| |
My App.Config file is not readable in Test Project. it works fine in the simple class library. |
Repro please |
Hello,
I'm attempting to use the latest CTP release of the VS adapter and am running into issues reading app settings from my app.config file in the test project.
I've created a simple test project with the following test:
...And added the following to the app.config file for the test project:
I have been able to get around this issue using the console runner by specifying
-domain:multiple
.If I switch Visual Studio back to the the old v2.x test adapter, the test passes.
The text was updated successfully, but these errors were encountered: