public void Configure_ConfigureCalled_SitecoreQueryConfigurationReturned()
        {
            //Assign
            SitecoreFieldAttribute attr = new SitecoreFieldAttribute(string.Empty);
            var propertyInfo = typeof(StubClass).GetProperty("DummyProperty");


            //Act
            var result = attr.Configure(propertyInfo) as SitecoreFieldConfiguration;

            //Assert
            Assert.IsNotNull(result);
        }
        public void Configure_SettingNotSet_SettingsReturnAsDefault()
        {
            //Assign
            SitecoreFieldAttribute attr = new SitecoreFieldAttribute(string.Empty);
            var propertyInfo = typeof(StubClass).GetProperty("DummyProperty");


            //Act
            var result = attr.Configure(propertyInfo) as SitecoreFieldConfiguration;

            //Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(SitecoreFieldSettings.Default, result.Setting);
        }
 public void Constructor_Sets_FieldName()
 {
     var testFieldName = "testFieldName";
     var testSitecoreFieldAttribute = new SitecoreFieldAttribute(testFieldName);
     Assert.AreEqual(testSitecoreFieldAttribute.FieldName, testFieldName);
 }
 public void Default_Constructor_Set_Setting_To_Default()
 {
     var testSitecoreFieldAttribute = new SitecoreFieldAttribute();
     Assert.AreEqual(testSitecoreFieldAttribute.Setting, SitecoreFieldSettings.Default);
 }
        public void Configure_SettingIsUnversioned_IsUnversionedIsSetOnConfiguration(
            [Values(true, false)] bool value,
            [Values(true, false)] bool expected)
        {
            //Assign
            SitecoreFieldAttribute attr = new SitecoreFieldAttribute(string.Empty);
            var propertyInfo = typeof(StubClass).GetProperty("DummyProperty");

            attr.IsUnversioned = value;

            //Act
            var result = attr.Configure(propertyInfo) as SitecoreFieldConfiguration;

            //Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(expected, result.IsUnversioned);
        }
        public void Configure_SettingFieldSource_FieldSourceIsSetOnConfiguration(
            [Values("field Source")] string value,
            [Values("field Source")] string expected)
        {
            //Assign
            SitecoreFieldAttribute attr = new SitecoreFieldAttribute(string.Empty);
            var propertyInfo = typeof(StubClass).GetProperty("DummyProperty");

            attr.FieldSource = value;

            //Act
            var result = attr.Configure(propertyInfo) as SitecoreFieldConfiguration;

            //Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(expected, result.FieldSource);
        }