public void GetField_FieldContainsEmptyString_ReturnsFloatZero()
        {
            //Assign
            string fieldValue = string.Empty;
            float expected = 0f;
            var fieldId = Guid.NewGuid();

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

            var mapper = new SitecoreFieldFloatMapper();

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

            //Assert
            Assert.AreEqual(expected, result);
        }
        public void GetField_FieldContainsEmptyString_ReturnsFloatZero()
        {
            //Assign
            string fieldValue = string.Empty;
            float expected = 0f;
            var item = Database.GetItem("/sitecore/content/Tests/DataMappers/SitecoreFieldFloatMapper/GetField");
            var field = item.Fields[FieldName];

            var mapper = new SitecoreFieldFloatMapper();

            using (new ItemEditing(item, true))
            {
                field.Value = fieldValue;
            }

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

            //Assert
            Assert.AreEqual(expected, result);
        }
        public void GetField_FieldContainsInvalidValidFloat_ReturnsFloat()
        {
            //Assign
            string fieldValue = "hello world";
            float expected = 3.141592f;
            var fieldId = Guid.NewGuid();

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


            //Act

            Assert.Throws<MapperException>(() =>
            {
                var result = (float) mapper.GetField(field, null, null);
            });
            //Assert
           
        }