public void TestConstructor() { _key = new TwoDimensionalKey(_first, _second); Assert.AreEqual(_first, _key.FirstKeyPart); Assert.AreEqual(_second, _key.SecondKeyPart); }
public void TestEquals() { // Test case: equality of two keys. TwoDimensionalKey key1 = new TwoDimensionalKey( InstrumentType.Instrument.Swaption, "AUD"); TwoDimensionalKey key2 = new TwoDimensionalKey( InstrumentType.Instrument.Swaption, "AUD"); TwoDimensionalKeyEqualityComparer comparerObj = new TwoDimensionalKeyEqualityComparer(); Assert.IsTrue(((IEqualityComparer)comparerObj).Equals(key1, key2)); // Test case: two keys are different. TwoDimensionalKey key3 = new TwoDimensionalKey( InstrumentType.Instrument.Swaption, "USD"); Assert.IsFalse(((IEqualityComparer)comparerObj).Equals(key1, key3)); }