Beispiel #1
0
        public void Value_Null()
        {
            var expression    = Utils.CreateEmptyExpression();
            var serialization = Utils.GetSerialization(expression);
            var complex       = new ComplexEntity(expression, null);
            var result        = complex.ToString();

            Assert.Equal("", result);
        }
Beispiel #2
0
        public void Normal_ShowTypeOnlyRoot()
        {
            var expression    = Utils.CreateEmptyExpression();
            var serialization = Utils.GetSerialization(expression);
            var complex       = new ComplexEntity(expression, this);
            var result        = complex.ToString();

            Assert.Equal($"{this.GetType().Name}.{this.GetHashCode()}", result);
        }
Beispiel #3
0
        public void ShowTypeOnlyName()
        {
            var expression    = Utils.CreateEmptyExpression();
            var serialization = Utils.GetSerialization(expression);

            serialization.ShowType = ShowTypeOptions.TypeName;
            var complex = new ComplexEntity(expression, this);
            var result  = complex.ToString();

            Assert.Equal($"SerializationComplexEntityTest.{this.GetHashCode()}", result);
        }
Beispiel #4
0
        public void NotShowTypeInRoot()
        {
            var expression    = Utils.CreateEmptyExpression();
            var serialization = Utils.GetSerialization(expression);

            serialization.ShowType = ShowTypeOptions.None;
            var complex = new ComplexEntity(expression, this);
            var result  = complex.ToString();

            Assert.Equal($"{this.GetHashCode()}", result);
        }