The problem is a bit weird : after upgrading CCNet to .Net framework 4.5 one test fails, and I do not know what the problem is.
° is it a breaking change in the .Net framework
° is it a different behavior of Nunit (I upgraded Nunit also to the latest version to be able to test .Net 4.5)
° something else ...
On using the new NUnit on the 1.8.5 tests, all tests are also green.
Below is the test, the bold line is the one that fails, it's one from the dashboard, IO namespace.
[Test]
public void NotAvailableNotEvenEqualToItself()
{
Assert.AreNotEqual(ConditionalGetFingerprint.NOT_AVAILABLE, ConditionalGetFingerprint.NOT_AVAILABLE);
Assert.AreSame(ConditionalGetFingerprint.NOT_AVAILABLE, ConditionalGetFingerprint.NOT_AVAILABLE);
}
as said before that one works in .Net 3.5, but not in .Net 4.5
I've updated the test to the following and still the same bold line breaks.
[Test]
public void NotAvailableNotEvenEqualToItself()
{
Assert.IsTrue(ConditionalGetFingerprint.NOT_AVAILABLE == ConditionalGetFingerprint.NOT_AVAILABLE);
Assert.IsTrue(ConditionalGetFingerprint.Equals(ConditionalGetFingerprint.NOT_AVAILABLE,
ConditionalGetFingerprint.NOT_AVAILABLE));
Assert.AreNotEqual(ConditionalGetFingerprint.NOT_AVAILABLE, ConditionalGetFingerprint.NOT_AVAILABLE);
Assert.AreSame(ConditionalGetFingerprint.NOT_AVAILABLE, ConditionalGetFingerprint.NOT_AVAILABLE);
}
The same test with the added asserts is still green in .Net 3.5 (with both versions of NUnit)
The code in CCNet uses statements like : (if fingerprint1 == fingerprint2)
as far as I could see, so I would guess that the functionality stays the same, but I'm not 100% sure :-(
.Equals() test that objects represent the same 'value', they may
represent different objects but the value of these are considered the
same.
That ConditionalGetFingerprint
does an override of the Equals method, so that's why the test is there,
and it breaks after upgrading.