.NET

nunit + mono + private methods don't play

Came across a gnarly difference in behavior between .NET runtime and Mono runtime. Take a look at this snippet.

[SetUp]
private void Setup()
{
  this.layout = new FeedLayout();
  this.layout.ActivateOptions();
  this.writer = new StringWriter();
}

Test-driven development using JUnit left me with the arguably proper habit of defining setup/teardown methods private. This practice works in nunit under .NET runtime - but not under mono. You must change the modifier to public - as in...

[SetUp]
public void Setup()
{
  this.layout = new FeedLayout();
  this.layout.ActivateOptions();
  this.writer = new StringWriter();
}

Syndicate content