Assert.AreEqual( object expected, object actual, string message,
object[] parms );
Do you know what kind of params can be used, this would be for me the easiest way how to change existing asserts.Just add formatting paremeters into existing
asserts
object expected, object actual, string
message, params object[] parameters )
The first object to compare. This is the object the unit test expects.
The second object to compare. This is the object the unit test produced.
A message to display if the assertion fails. This message can be seen in the unit test results.
An array of parameters to use when formatting message.
object expected, object actual, string
message, params object[] parameters )
The first object to compare. This is the object the unit test expects.
The second object to compare. This is the object the unit test produced.
A message to display if the assertion fails. This message can be seen in the unit test results.
An array of parameters to use when formatting message.
Sure.. just use standard .NET string formatting as you would with
As I explained in my first answer, you can only change that original output if you are able to override ToString for the type. That's not possible for bytes so change to nunit would be needed.
Hi Charlie,
I’m guessing here, but I assume it would not be difficult to write your own custom Assert? You could then make it do anything you wanted. Right?
Best wishes,
Richard Howells
https://github.com/nunit/docs/wiki/TestContext
Haven't used it myself though.
That's true... I forgot we had added that. If you use it in a OneTimeSetUp it will remain in effect for all tests under it.