Ejemplo n.º 1
0
        public void MakeEmptyStringsNull_ObjectContainsNullNestedObject_DoesNotThrowException()
        {
            var complexObject = new ComplexObject
            {
                InnerObject = null
            };

            var exception = Record.Exception(() => complexObject.MakeEmptyStringsNull());

            Assert.Null(exception);
        }
Ejemplo n.º 2
0
        public void MakeEmptyStringsNull_ObjectContainsNullNestedObject_DoesNotThrowException()
        {
            var complexObject = new ComplexObject
            {
                InnerObject = null
            };

            var exception = Record.Exception(() => complexObject.MakeEmptyStringsNull());

            Assert.Null(exception);           
        }
Ejemplo n.º 3
0
        public void MakeEmptyStringsNull_ObjectContainsEmptyStringInNestedObject_ConvertsToNull()
        {
            var complexObject = new ComplexObject
            {
                InnerObject = new SimpleObject
                {
                    MyString = string.Empty
                }
            };

            var result = complexObject.MakeEmptyStringsNull();

            Assert.Null(result.InnerObject.MyString);
        }
Ejemplo n.º 4
0
        public void MakeEmptyStringsNull_ObjectContainsEmptyStringInNestedObject_ConvertsToNull()
        {
            var complexObject = new ComplexObject
            {
                InnerObject = new SimpleObject
                {
                    MyString = string.Empty
                }
            };

            var result = complexObject.MakeEmptyStringsNull();

            Assert.Null(result.InnerObject.MyString);
        }