public void ConfigurationFileShouldSupercedeApiForReplace() { var testSubject = new DataServiceBehavior { AcceptReplaceFunctionInQuery = false }; DataServicesReplaceFunctionFeature replaceFeature = new TestReplaceFeature(true) { Enable = true }; DataServicesFeaturesSection dataServicesFeaturesSection = new DataServicesFeaturesSection { ReplaceFunction = replaceFeature }; testSubject.ApplySettingsFromConfiguration(dataServicesFeaturesSection); testSubject.AcceptReplaceFunctionInQuery.Should().BeTrue(); replaceFeature.Enable = false; testSubject.ApplySettingsFromConfiguration(dataServicesFeaturesSection); testSubject.AcceptReplaceFunctionInQuery.Should().BeFalse(); }
public void ConfigurationFileShouldForReplaceShouldOnlyBeAppliedIfPresent() { var testSubject = new DataServiceBehavior { AcceptReplaceFunctionInQuery = true }; testSubject.ApplySettingsFromConfiguration(new DataServicesFeaturesSection { ReplaceFunction = new TestReplaceFeature(false) { Enable = false } }); testSubject.AcceptReplaceFunctionInQuery.Should().BeTrue(); }