Re: TypeInitializationException / forcing all static c'tors to run on startup

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



NUnit is specifically for frequent unit testing.

Ok great!

It doesn't happen when
you run your application - it happens when you run your tests. That
should happen (IMO) much more often than you start your application.

Ah, I see. Yes, unless you're like me and your application is the
unit tests. But, if my app wasn't, and the unit tests were in another
project, I can totally see why this test project would be run much
more often. It's the *reason* my app is run so often - for testing.

Running tests should be pretty much as frequent as building - and you
need to write your unit tests appropriately so they run quickly.

As i write code, I test it inside of my app by running it. So, if the
unit test project does the testing, then *that's* the code i'll be
running all the time.

Of course, you may decide to have different categories of unit tests,
some of which will take longer to run - but in general, tests which are
run most often are the most useful ones.

I agree. But, the longer tests have value in specific applications.
Such as stress testing multithreading apps. I've done that to confirm
bugs that should exist during mid-implementation, and confirm (within
reason) that they no longer exist once I've solve the problem.

I suppose this change of pace is what 'test driven development' is all
about? It means I've been doing it for a long time, just not quite on
track.

Zytan

.



Relevant Pages

  • Re: edit & continue
    ... > and just run the app in the dubugger to test it. ... there is little realistic way to perform unit tests, ... > solid reason, "If I encounter a simple mistake I can fix it without ... > practice talk that only seems to apply if you are following a certain ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: TypeInitializationException / forcing all static ctors to run on startup
    ... But, if my app wasn't, and the unit tests were in another ... I can totally see why this test project would be run much ... It's the *reason* my app is run so often - for testing. ... having a static constructor in a class subtly changes the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Exception when use MessageBox.Show in prog with long path
    ... We too are seeing similar errors over here with a 1.1 app. ... The other day one of our devs reported that the unit tests were failing ... Sometimes the MessageBox would successfully pop up, ... but rather to the directory where the EXE is. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: .NET-BroadcastEventwindow.1.0.3300.0.9:---Application Error
    ... My app is a C# P/Invoke wrapper around a DLL. ... Running the unit tests seem to be fine. ... Windows Forms team will investigate the bug. ...
    (microsoft.public.dotnet.framework.clr)
  • Simple race condition that I cant solve.
    ... Today I found that an app I'm working on has a race condition. ... I made a simple project that reproduces it, and I've attached that to this ... I can reproduce it every time with this test project. ...
    (microsoft.public.dotnet.framework)