Thread.CurrentThread.CurrentCulture & NUnit issue
C#
1
Posts
1
Posters
0
Views
1
Watching
-
Hello, there is a c# method perfoming some operations:
protected override bool checkDatalinkEntry(PlausicheckKernel.Datalink.DatalinkEntry entry, ref string msgReason, ref string msgReasonShort)
{
bool retValue;//... Thread.CurrentThread.CurrentCulture.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Monday; //... Thread.CurrentThread.CurrentCulture.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Sunday; //... return retValue; }
In addition, there is a unit test method which calls checkDatalinkEntry. Calling the test method from main will work, but calling the test via nunit gui,
System.InvalidOperationException
is thrown (instance is write protected) at settingFirstDayOfWeek
property. Any idea on how to fix this? I don't want to modify my businesslogic (checkDatalinkEntry) for nunit.. thanks in advance