I have one inner static class MyLists with a static member
internal static ImmutableArray<string> MyList = new ImmutableArray<string> { "asd", "qwe" };
In another test class for public tests, I have a MyTest function that selects and compares a list. I get
Additional information: The type initializer for 'TestMyLists' threw an exception.
Object reference not set to an instance of an object.
[TestClass]
public class MyTests {
[TestMethod]
public void TestMyLists() {
var list = MyLists.MyList.Select(s => s + ".foo");
}
}
When I debug, I see the ImmutableArray static object as value = Uninitialized. Why?
source
share