For my unit test, I'm trying to use constants from a static class (ModelConstants
) of my main project in my testing project.
int ones = ModelConstants.PLOT_STORE_PRECISION_FACTOR * ModelConstants.RECENT_SAMPLES;
When trying to run this test method, I get a TypeInitializationException
on the line above. InnerException is a FileNotFoundException
saying the assembly System.Windows
could not be found. This makes no sense to me, but I guess the static constants class could somehow not be initialized correctly. What could be the reason for this?
Btw, I can instantiate non-static classes of my main project without any problems.
Edit:
The constants are defined as follows:
public static readonly int TRACKING_INTERVAL = 200;
public static readonly int SAMPLE_WINDOW = 3;
public static readonly int PLOT_STORE_PRECISION_FACTOR = 1000 / TRACKING_INTERVAL;