public void Test_that_for_no_matched_type_null_value_type_merging_strategy_is_returned() { // Arrange var provider = new ConventionBasedMetamodelProvider(); IMetamodelProvider metamodelProvider = provider; provider.AddTypeValueTypesMergingStrategyRule(t => t.Name == "FictionalTipe", ValueTypeMergingStrategy.UpdateIfDirty); // Act var strategy = metamodelProvider.TryGetValueTypeMergingStrategy(typeof(TestType)); // Assert Assert.AreEqual(ValueTypeMergingStrategy.None, strategy); }
public void Test_that_type_value_type_merging_strategy_rules_applied_in_the_same_order_as_they_was_registered2() { // Arrange var provider = new ConventionBasedMetamodelProvider(); IMetamodelProvider metamodelProvider = provider; provider .AddTypeValueTypesMergingStrategyRule(t => t.Name == "AnotherTestType", ValueTypeMergingStrategy.UpdateAlways) .AddTypeValueTypesMergingStrategyRule(t => t.Name.EndsWith("TestType"), ValueTypeMergingStrategy.UpdateIfDirty); // Act var testTypeStrategy = metamodelProvider.TryGetValueTypeMergingStrategy(typeof(TestType)); var anotherTestTypeStrategy = metamodelProvider.TryGetValueTypeMergingStrategy(typeof(AnotherTestType)); // Assert Assert.AreEqual(ValueTypeMergingStrategy.UpdateIfDirty, testTypeStrategy); Assert.AreEqual(ValueTypeMergingStrategy.UpdateAlways, anotherTestTypeStrategy); }