public void SetEmptyDefaultValue() { var dataType = CremaDataTypeUtility.GetBaseTypes().Random(); var defaultValue = CremaConvert.ToString(RandomUtility.Next(dataType)); this.column.DefaultValue = defaultValue; this.column.DataTypeName = dataType.GetTypeName(); this.column.DefaultValue = string.Empty; Assert.AreEqual(DBNull.Value, this.column.DefaultValue); }
public void SetDefaultValueAsString() { this.column.DataType = CremaDataTypeUtility.GetBaseTypes().Random(); var newDefaultValue = RandomUtility.Next(this.column.DataType); this.column.DefaultValue = CremaConvert.ToString(newDefaultValue); if (this.column.DataType == typeof(DateTime)) { Assert.AreEqual(newDefaultValue.ToString(), this.column.DefaultValue.ToString()); } else { Assert.AreEqual(newDefaultValue, this.column.DefaultValue); } }
public DomainPropertySerializationInfo(string name, object value) { this.Name = name; this.Type = value.GetType().GetTypeName(); this.Value = CremaConvert.ToString(value); }