Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Thread.CurrentThread.CurrentCulture & NUnit issue

Thread.CurrentThread.CurrentCulture & NUnit issue

Scheduled Pinned Locked Moved C#
helpcsharptestingtutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    buchstaben
    wrote on last edited by
    #1

    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 setting FirstDayOfWeek property. Any idea on how to fix this? I don't want to modify my businesslogic (checkDatalinkEntry) for nunit.. thanks in advance

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups