SenseNet.ContentRepository.Tests.FieldTest.FieldOnHandler_NumberOnDouble C# (CSharp) Метод

FieldOnHandler_NumberOnDouble() приватный Метод

private FieldOnHandler_NumberOnDouble ( ) : void
Результат void
        public void FieldOnHandler_NumberOnDouble()
        {
            decimal originalValue;
            decimal currentValue;
            Double handlerValue;
            string fieldName = "Double";
            decimal defaultValue = 0;
            decimal testValue = 123.456m;
            Double defaultHandlerValue = 0;
            Double testHandlerValue = 123.456d;

            Content content = Content.CreateNew("FieldOnHandlerTest", Repository.Root, "FieldTest");
            ContentAccessor contentAcc = new ContentAccessor(content);
            FieldTestHandler handler = (FieldTestHandler)content.ContentHandler;

            originalValue = (decimal)content.Fields[fieldName].OriginalValue;
            Assert.IsTrue(originalValue == defaultValue, "#1");
            currentValue = (decimal)content[fieldName];
            Assert.IsTrue(currentValue == defaultValue, "#2");
            handlerValue = handler.Double;
            Assert.IsTrue(handlerValue == defaultHandlerValue, "#3");

            content[fieldName] = testValue;
            originalValue = (decimal)content.Fields[fieldName].OriginalValue;
            Assert.IsTrue(originalValue == defaultValue, "#4");
            currentValue = (decimal)content[fieldName];
            Assert.IsTrue(currentValue == testValue, "#5");
            contentAcc.SaveFields();
            originalValue = (decimal)content.Fields[fieldName].OriginalValue;
            Assert.IsTrue(originalValue == testValue, "#6");
            currentValue = (decimal)content[fieldName];
            Assert.IsTrue(currentValue == testValue, "#7");
            handlerValue = handler.Double;
            Assert.IsTrue(handlerValue == testHandlerValue, "#8");

            content[fieldName] = defaultValue;
            originalValue = (decimal)content.Fields[fieldName].OriginalValue;
            Assert.IsTrue(originalValue == testValue, "#9");
            currentValue = (decimal)content[fieldName];
            Assert.IsTrue(currentValue == defaultValue, "#10");
            contentAcc.SaveFields();
            originalValue = (decimal)content.Fields[fieldName].OriginalValue;
            Assert.IsTrue(originalValue == defaultValue, "#11");
            currentValue = (decimal)content[fieldName];
            Assert.IsTrue(currentValue == defaultValue, "#12");
            handlerValue = handler.Double;
            Assert.IsTrue(handlerValue == defaultHandlerValue, "#13");
        }
        [TestMethod]
FieldTest