nunit/nunit — pull request #414 by rprouse (2014-12-08 10:20:28+00:00)
Title: Issue 234 - Update C++ Unit Test Examples

## Do Not Merge ##

This PR matches the same one in the nunit-cpp-samples repository.

I am pushing this early for discussion. So far, I have removed the various `Assert.That(ref)` and `Expect(ref)` overloads because they are not CLS compliant. I don't think this functionality is used often and it can be replaced with a delegate or a lambda as can be seen in the unit tests.

In the C++ projects, they were causing errors like,

```
1>cpp-cli-syntax.cpp(197): error C2668: 'NUnit::Framework::AssertionHelper::Expect' : ambiguous call to overloaded function
1> c:\src\github\nunit\bin\debug\net-4.0\nunit.framework.dll: could be 'void NUnit::Framework::AssertionHelper::Expect(NUnit::Framework::TestDelegate ^,NUnit::Framework::Constraints::IResolveConstraint ^)'
1> c:\src\github\nunit\bin\debug\net-4.0\nunit.framework.dll: or 'void NUnit::Framework::AssertionHelper::Expect(bool,System::String ^)'
1> c:\src\github\nunit\bin\debug\net-4.0\nunit.framework.dll: or 'void NUnit::Framework::AssertionHelper::Expect(bool,System::String ^,...cli::array ^)'
1> c:\src\github\nunit\bin\debug\net-4.0\nunit.framework.dll: or 'void NUnit::Framework::AssertionHelper::Expect(System::String ^%,NUnit::Framework::Constraints::IResolveConstraint ^)'
1> c:\src\github\nunit\bin\debug\net-4.0\nunit.framework.dll: or 'void NUnit::Framework::AssertionHelper::Expect(System::String ^,NUnit::Framework::Constraints::IResolveConstraint ^)'
1> while trying to match the argument list '(System::String ^, NUnit::Framework::Constraints::ContainsConstraint ^)'
```

All of the C++ unit tests are passing and building now, but I would still like to look at the following.

- Tests using the various `ComparisonContraint`s give a build warning about implicit boxing.

And @CharliePoole asked me to look at the following,

- Assert with Message Overload

Every Assert method has three overloads: no message, message, message-plus-args. For C# we don't really need the second one, because the argument list is a params array. I have always kept the second, believing it was needed for some languages.

What happens if we drop the third option? Can C++ still make asserts with just a message, or does it have to pass an empty array of args?

- Numeric Overloads for Some Asserts

Even though we have a generic assert signature we also have numeric overloads for some asserts: AreEqual for example. We kept those based on the idea that some languages would not handle the generics correctly, possibly not working at all or possibly boxing the args, which is inefficient.

What happens in C++ if we drop some of those overloads? Does it work at all? Can you tell if the generic is used correctly? Or is some other overload used?

*****

This comes up because I was a bit dismayed at how many overloads we have in Assert.cs. If we can prune it a bit, there will be fewer things to go wrong.