public override void ConfigureDataHandler(SitecoreProperty scProperty) { SitecoreQueryAttribute attr = scProperty.Attribute as SitecoreQueryAttribute; IsLazy = attr.IsLazy; IsRelative = attr.IsRelative; Query = attr.Query; InferType = attr.InferType; base.ConfigureDataHandler(scProperty); }
public void Configure_ConfigureCalled_SitecoreQueryConfigurationReturned() { //Assign SitecoreQueryAttribute attr = new SitecoreQueryAttribute(string.Empty); var propertyInfo = typeof(StubClass).GetProperty("QueryContextProperty"); //Act var result = attr.Configure(propertyInfo) as SitecoreQueryConfiguration; //Assert Assert.IsNotNull(result); }
public void Configure_ConfigureQueryContext_QueryContextSetOnConfigObject( [Values(true, false)] bool queryContextValue, [Values(true, false)] bool expectedValue) { //Assign SitecoreQueryAttribute attr = new SitecoreQueryAttribute(string.Empty); var propertyInfo = typeof(StubClass).GetProperty("QueryContextProperty"); attr.UseQueryContext = queryContextValue; //Act var result = attr.Configure(propertyInfo) as SitecoreQueryConfiguration; //Assert Assert.AreEqual(expectedValue, result.UseQueryContext); }