Hi Eduardo, your test case contains a few syntax errors:
1.) You defined SetUp() twice (I guess you wanted to call one of them ShutDown).
2.) In TestCtor2, you tried to pass a class `Encoding' as an argument
to the constructor. MCS will now correctly report a syntax error
when you attempt to do this rather than crashing.
The correct way to do it is
BinaryReader r = new BinaryReader((Stream)null,Encoding.Unicode);
This'll pass an instance of this class (ie. an object) to the
constructor, not the class itself.
3.) I don't know what you wanted to do with
byte[] b = new byte[30];
BinaryReader r = new BinaryReader(m,(Encoding)b[2]);
You cannot convert a single byte into an object. Changing this to
BinaryReader r = new BinaryReader(m,(Encoding)null);
like you did a few lines earlier should do it.
4.) I think you must link against NUnitCore_mono.dll, not
NUnitCore.dll, but not sure.
Here's your corrected test case:
BinaryReaderTest.cs
Description: Binary data
Btw. you should update your runtime, class libraries and mcs first - I
committed some larger changes to it today.
Martin
Eduardo Garcia Cebollero <[EMAIL PROTECTED]> writes:
> I'm doing the System.IO.BinaryReader NUnit test, when i try to compile
> it, i get the following error from mcs:
>
> $ mcs BinaryReaderTest.cs -r /usr/lib/NUnitCore.dll -target:library
>
> ** (process:11847): WARNING **: unhandled exception System.Exception:
> "Implement me"
> in <0x0007c> (runtime invoke wrapper) Mono.CSharp.Driver:Main
> (object,intptr,intptr)
>
> It occours while compiling the atachment, It's my first NUnit test, i
> don't know if it's my fail or not.
>
> I tryed to isolate the error and it only appear if the TestCtor2()
> method is present, i think the error occour while trying to compile the
> try{....}catch(...){....} when a null reference is passed by parameter
> to BinaryReader constructor with encoding.
>
> I wish the information is usefull.
>
> and I would like to have advice or tips about the test :)
>
> Thanks for the time and excuseme for my poor english.
>
> --
> Eduardo Garcia Cebollero <[EMAIL PROTECTED]>
>
--
Martin Baulig
[EMAIL PROTECTED]
