public void CheckValue_Single() { var expression = Utils.CreateEmptyExpression(); var serialization = Utils.GetSerialization(expression); var fieldEntity = new PropertyEntity(expression, this, GetPropertyByName("Single")); var result = fieldEntity.ToString(); Assert.Equal("Single: 3.40282346638529E+38", result); }
public void CheckValue_Char() { var expression = Utils.CreateEmptyExpression(); var serialization = Utils.GetSerialization(expression); var fieldEntity = new PropertyEntity(expression, this, GetPropertyByName("Char")); var result = fieldEntity.ToString(); Assert.Equal("Char: Ê", result); }
public void CheckValue_Decimal() { var expression = Utils.CreateEmptyExpression(); var serialization = Utils.GetSerialization(expression); var fieldEntity = new PropertyEntity(expression, this, GetPropertyByName("Decimal")); var result = fieldEntity.ToString(); Assert.Equal("Decimal: -79228162514264337593543950335", result); }
public void CheckValue_IntPtr() { var expression = Utils.CreateEmptyExpression(); var serialization = Utils.GetSerialization(expression); var fieldEntity = new PropertyEntity(expression, this, GetPropertyByName("IntPtr")); var result = fieldEntity.ToString(); Assert.Equal("IntPtr: 9223372036854775807", result); }
public void CheckValue_UInt64() { var expression = Utils.CreateEmptyExpression(); var serialization = Utils.GetSerialization(expression); var fieldEntity = new PropertyEntity(expression, this, GetPropertyByName("UInt64")); var result = fieldEntity.ToString(); Assert.Equal("UInt64: 18446744073709551615", result); }
public void CheckValue_DateTimeOffset() { var expression = Utils.CreateEmptyExpression(); var serialization = Utils.GetSerialization(expression); var fieldEntity = new PropertyEntity(expression, this, GetPropertyByName("DateTimeOffset")); var result = fieldEntity.ToString(); Assert.Equal("DateTimeOffset: 2000-01-01T00:00:00.000+00:00", result); }
public void ValueString_Normal() { var expression = Utils.CreateEmptyExpression(); var serialization = Utils.GetSerialization(expression); var prop1Complex = new PropertyEntity(expression, this, GetPropertyByName("PropString")); var result = prop1Complex.ToString(); Assert.Equal("PropString: abc \" def \"ghi\"", result); }
public void Property() { var expression = Utils.CreateEmptyExpression(); var serialization = Utils.GetSerialization(expression); var prop1Complex = new PropertyEntity(expression, this, GetPropertyByName("PropInt")); var result = prop1Complex.ToString(); Assert.Equal("PropInt: 100", result); }
public void ShowTypeOnlyName() { var expression = Utils.CreateEmptyExpression(); var serialization = Utils.GetSerialization(expression); serialization.ShowType = ShowTypeOptions.TypeName; var prop1Complex = new PropertyEntity(expression, this, GetPropertyByName("PropInt")); var result = prop1Complex.ToString(); Assert.Equal("Int32.PropInt: 100", result); }
public void ValueString_TruncateValue2() { var expression = Utils.CreateEmptyExpression(); var serialization = Utils.GetSerialization(expression); serialization.ValueFormatter = new TruncateFormatter(3); var prop1Complex = new PropertyEntity(expression, this, GetPropertyByName("PropString")); var result = prop1Complex.ToString(); Assert.Equal("PropString: abc", result); }
public void ValueString_Null_Parent_WithoutType() { var expression = Utils.CreateEmptyExpression(); var serialization = Utils.GetSerialization(expression); serialization.ShowType = ShowTypeOptions.None; this.PropString = null; var prop1Complex = new PropertyEntity(expression, null, GetPropertyByName("PropString")); var result = prop1Complex.ToString(); Assert.Equal("PropString", result); }
public void CheckValue_CharNullable() { var expression = Utils.CreateEmptyExpression(); var serialization = Utils.GetSerialization(expression); serialization.ShowType = ShowTypeOptions.TypeName; var fieldEntity = new PropertyEntity(expression, this, GetPropertyByName("CharNullable")); var result = fieldEntity.ToString(); Assert.Equal("Nullable`1.CharNullable: Ê", result); serialization.ShowType = ShowTypeOptions.None; CharNullable = null; fieldEntity = new PropertyEntity(expression, this, GetPropertyByName("CharNullable")); result = fieldEntity.ToString(); Assert.Equal("CharNullable", result); }
public void CheckValue_DecimalNullable() { var expression = Utils.CreateEmptyExpression(); var serialization = Utils.GetSerialization(expression); serialization.ShowType = ShowTypeOptions.TypeName; var fieldEntity = new PropertyEntity(expression, this, GetPropertyByName("DecimalNullable")); var result = fieldEntity.ToString(); Assert.Equal("Nullable`1.DecimalNullable: -398131469920926319565547489.12", result); serialization.ShowType = ShowTypeOptions.None; DecimalNullable = null; fieldEntity = new PropertyEntity(expression, this, GetPropertyByName("DecimalNullable")); result = fieldEntity.ToString(); Assert.Equal("DecimalNullable", result); }
public void CheckValue_DateTimeOffsetNullable() { var expression = Utils.CreateEmptyExpression(); var serialization = Utils.GetSerialization(expression); serialization.ShowType = ShowTypeOptions.TypeName; var fieldEntity = new PropertyEntity(expression, this, GetPropertyByName("DateTimeOffsetNullable")); var result = fieldEntity.ToString(); Assert.Equal("Nullable`1.DateTimeOffsetNullable: 2000-01-01T00:00:00.000+00:00", result); serialization.ShowType = ShowTypeOptions.None; DateTimeOffsetNullable = null; fieldEntity = new PropertyEntity(expression, this, GetPropertyByName("DateTimeOffsetNullable")); result = fieldEntity.ToString(); Assert.Equal("DateTimeOffsetNullable", result); }