public void GetField_FieldValueStringEmpty_ReturnsFalse()
        {
            //Assign
            var item = Database.GetItem("/sitecore/content/Tests/DataMappers/SitecoreFieldBooleanMapper/GetField");
            var fieldName = "Field";
            var value = string.Empty;
            var mapper = new SitecoreFieldBooleanMapper();


            var field = item.Fields[fieldName];
            using (new SecurityDisabler())
            {
                item.Editing.BeginEdit();
                field.Value = value;
                item.Editing.EndEdit();
            }

            //Act
            var result = mapper.GetField(field, null, null);


            //Assert
            Assert.AreEqual(false, result);

        }
        public void GetField_FieldValueZero_ReturnsFalse()
        {
            //Assign
            
            var fieldName = "Field";
            var fieldValue = "0";

            var fieldId = Guid.NewGuid();

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


            var mapper = new SitecoreFieldBooleanMapper();

            //Act
            var result = mapper.GetField(field, null, null);

            //Assert
            Assert.AreEqual(false, result);

        }
        public void SetField_ValueTrue_FieldSetToOne()
        {
            //Assign
            var item = Database.GetItem("/sitecore/content/Tests/DataMappers/SitecoreFieldBooleanMapper/GetField");
            var fieldName = "Field";
            var expected = "1";
            var mapper = new SitecoreFieldBooleanMapper();
            var value = true;

            var field = item.Fields[fieldName];
            using (new SecurityDisabler())
            {
                item.Editing.BeginEdit();
                field.Value = string.Empty;
                item.Editing.EndEdit();
            }

            //Act
            using (new SecurityDisabler())
            {
                item.Editing.BeginEdit();
                mapper.SetField(field, value, null, null);
                item.Editing.EndEdit();
            }

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

        }
        public void SetField_ValueTrue_FieldSetToOne()
        {
            //Assign
           
            var fieldName = "Field";
            var expected = "1";
            var mapper = new SitecoreFieldBooleanMapper();
            var objectValue = true;
            var fieldId = Guid.NewGuid();

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

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

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

        }