コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }