示例#1
0
 public void TestConstructor()
 {
     _key = new
            TwoDimensionalKey(_first, _second);
     Assert.AreEqual(_first, _key.FirstKeyPart);
     Assert.AreEqual(_second, _key.SecondKeyPart);
 }
示例#2
0
        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));
        }