locked
xUnit project type and App.Config file RRS feed

  • Question

  • HI,

    I have a .net standard project under test and I want to test it using xUnit,

    with Visual Studio I got xUnit Test project (Core 2.0), I created this project and add reference to my other projects and nuget libraries for configurationManager.

    Apart from that App.Config file is also added to test ptoject.

    Now when I try to access System.Config.ConfigurationManager.AppSetting.Keys.count , I am always getting 0.

    Same is the case with MSUnit core, nUnit Core while the Unit test project works as expected.
    Please do let me know what am I missing.

    Note - Project under test uses the System.Configuration.CongifurationManager, so I can not pass settings from testing project to the project under test.

    Wednesday, July 25, 2018 9:43 AM