Last post Aug 17, 2010 07:16 AM by misuk11
Aug 17, 2010 07:16 AM|misuk11|LINK
Ive created an NUnit test project in my solution and have added 3 tests. They all fail with the same error
SetUp : System.TypeInitializationException : The type initializer for 'Systems.Utils.ConstantHelpers' threw an exception.
----> System.NullReferenceException : Object reference not set to an instance of an object.
heres the test method
public void CreateDataContext_ConnectionString_ReturnsDataContextObject()
Data.DBDataContext DBContext = new Systems.Data.ConnectorDBDataContext("DBConnection");
Systems.Utils.ConstantHelpers are a set of helper methods that retrieve connection strings and application keys from the web.config file. Im not using this anywhere in my test project, ive hardcoded the connection string, I had previously used it, but removed
it because of the error, but its still there. I tried placing an app.config file in the test project directory with the same connection strings, but it doesnt work. How can my test project interact with a config file ? I cant see why im getting this error
anyway since im not using Systems.Utils.ConstantHelpers. Anyone any idea what the problem could be ?