public void SetField_ObjectIsInt_ThrowsException()
        {
            //Assign
            string objectValue = "hello world";
            var fieldId = Guid.NewGuid();

            var item = Helpers.CreateFakeItem(fieldId, string.Empty);
            var field = item.Fields[new ID(fieldId)];

            var config = new SitecoreFieldConfiguration();
            config.PropertyInfo = typeof(Stub).GetProperty("Property");

            var mapper = new SitecoreFieldNullableEnumMapper();

            //Act
            Assert.Throws<ArgumentException>(() =>
            {
                mapper.SetField(field, objectValue, config, null);

            });

            //Assert
        }
        public void SetField_ObjectisValidEnum_SetsFieldValue()
        {
            //Assign
            string expected = "Value2";
            StubEnum objectValue = StubEnum.Value2;
            var fieldId = Guid.NewGuid();

            var item = Helpers.CreateFakeItem(fieldId, string.Empty);
            var field = item.Fields[new ID(fieldId)];

            var config = new SitecoreFieldConfiguration();
            config.PropertyInfo = typeof(Stub).GetProperty("Property");

            var mapper = new SitecoreFieldNullableEnumMapper();

            item.Editing.BeginEdit();

            //Act
           
                mapper.SetField(field, objectValue, config, null);
            


            //Assert
            Assert.AreEqual(expected, field.Value);
        }