> Krister,
> 
> I don't get this on my Linux box, however the ConvertTest is causing NUnit
> some other kinds of problems.  See my post to Duncan.
> 
> One thing Duncan helped me notice was that I am not using the GC with my
> mono (as far as I can tell). This might be a difference worth exploring.
> 
> I'll see what I can track down at home tonight.
> 
> Later,
> Nick D.

Hey Nick!

Made a little program that demonstrates the error. It is attached to this message. I 
got this when I ran it on win2k/cygwin.

$ mono ConvTest.exe
Errors   : 1
System.NullReferenceException
A null value was found where an object instance was requiredSystem.NullReference
Exceptionin (unmanaged) System.Type:get_method ()
in <0x00099> NUnit.Framework.TestCase:RunTest ()
in <0x0001c> NUnit.Framework.TestCase:RunBare ()
in <0x00010> .ProtectedProtect:Protect ()
in <0x00034> NUnit.Framework.TestResult:RunProtected (NUnit.Framework.ITest,NUni
t.Framework.IProtectable)

Failures : 0
RESULT: 0

This gives more info about the problem. Are you getting the same error message too??

/Krister

using NUnit.Framework;
using System;
using System.Threading;
using System.Globalization;

public class DecimalInitiation : TestCase {
        public DecimalInitiation() : base( "DecimalInitiation" ) {}
        public DecimalInitiation(string name) : base(name) {}

        decimal tryDec;
        
        protected override void SetUp() {
                Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US", false);
                tryDec = 1234.2345m;
        }
        protected override void TearDown() {}
        public static ITest Suite {
                get { 
                        return new TestSuite( typeof( DecimalInitiation ) ); 
                }
        }
        public void Test1() {
                AssertEquals("#A01", "hello", "hello");
                AssertEquals("#A02", "1234,2345", Convert.ToString(tryDec));
  }
}

public class Testing {
        public static void Main() {
                TestResult result = new TestResult();
                TestSuite suite = new TestSuite();

                suite.AddTest( DecimalInitiation.Suite );

                suite.Run( result );

                Console.WriteLine( "Errors   : " + result.ErrorCount );
                foreach( TestFailure f in result.Errors ) {
                        Console.WriteLine( f.ThrownException );
                }

                Console.WriteLine( "Failures : " + result.FailureCount );
                foreach( TestFailure f in result.Failures ) {
                        Console.WriteLine( f.ThrownException );
                }
        }
}

Reply via email to