I have an issue with a class that I'm trying to test. I've declared a private enum and I'm using that in a generic dictionary in the code. This enum has no meaning outside of this class but it's used in a private method. When I generated the code the accessor is written into the generic dictionary type, but throws an invalid cast exception when I try to use the test.
MyClass_Accessor target = new MyClass_Accessor();
Dictionary<MyClass_Accessor.MyEnum, long> dictionary = new Dictionary<MyClass_Accessor.MyEnum, long>();
dictionary.Add(MyClass_Accessor.Myenum.EnumValue, 1);
target.Method(dictionary); //Throws invalid cast exception here.
The exception is that the generic dictionary of accessor => enum, long cannot be converted to Myclass => enum, long.
Other than altering my working class, is there a way that I can test this method?