public void TestMergeStockCollectionConflictResolutionOverwrite() { var a1 = GetStockAttributesCollection(); var a2 = new DDAttributesCollection(); var newValue = new DrOpen.DrCommon.DrData.DDValue(1); a2.Add(TEST_ENUM.TEST_ENUM_a, newValue); a1.Merge(a2, DrOpen.DrCommon.DrData.ResolveConflict.OVERWRITE); Assert.IsFalse(a1 == GetStockAttributesCollection(), "The both attribute collection cannot be equals."); Assert.IsTrue(a1.GetValue(TEST_ENUM.TEST_ENUM_a, null) == newValue, "The attribute must have new value."); }
public void TestMergeStockCollectionConflictResolutionThrow() { var a1 = GetStockAttributesCollection(); var a2 = new DDAttributesCollection(); var newValue = new DrOpen.DrCommon.DrData.DDValue(1); a2.Add(TEST_ENUM.TEST_ENUM_a, newValue); try { a1.Merge(a2, DrOpen.DrCommon.DrData.ResolveConflict.THROW_EXCEPTION); Assert.Fail("Cannot catch exception!"); } catch (DDAttributeExistsException e) { Assert.AreEqual(e.Name, TEST_ENUM.TEST_ENUM_a.ToString()); } }