本文整理汇总了C#中CodeGenerator.GenerateFromType方法的典型用法代码示例。如果您正苦于以下问题:C# CodeGenerator.GenerateFromType方法的具体用法?C# CodeGenerator.GenerateFromType怎么用?C# CodeGenerator.GenerateFromType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CodeGenerator
的用法示例。
在下文中一共展示了CodeGenerator.GenerateFromType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Char_Default
public void Char_Default()
{
var codeGenerator = new CodeGenerator();
CodeGeneratorProperty generatedProperty = codeGenerator.GenerateFromType<Char>();
Assert.AreEqual(WidgetType.TextBox, generatedProperty.WidgetType);
Assert.AreEqual(DatabaseColumnType.Char, generatedProperty.DatabaseColumn.Type);
Assert.AreEqual(1, generatedProperty.DatabaseColumn.Size);
Assert.AreEqual(MaskType.None, generatedProperty.Mask);
}
示例2: String_Default
public void String_Default()
{
var codeGenerator = new CodeGenerator();
CodeGeneratorProperty generatedProperty = codeGenerator.GenerateFromType<String>();
Assert.AreEqual(WidgetType.TextBox, generatedProperty.WidgetType);
Assert.AreEqual(DatabaseColumnType.VarChar, generatedProperty.DatabaseColumn.Type);
Assert.AreEqual(ValidationType.None, generatedProperty.Validation.Type);
Assert.AreEqual(50, generatedProperty.DatabaseColumn.Size);
Assert.AreEqual(MaskType.None, generatedProperty.Mask);
}
示例3: Int64_Default
public void Int64_Default()
{
var codeGenerator = new CodeGenerator();
CodeGeneratorProperty generatedProperty = codeGenerator.GenerateFromType<Int64>();
Assert.AreEqual(WidgetType.TextBox, generatedProperty.WidgetType);
Assert.AreEqual(DatabaseColumnType.BigInt, generatedProperty.DatabaseColumn.Type);
Assert.AreEqual(8, generatedProperty.DatabaseColumn.Size);
Assert.AreEqual(ValidationType.Range, generatedProperty.Validation.Type);
Assert.AreEqual(Int64.MinValue, generatedProperty.Validation.MinimumValue);
Assert.AreEqual(Int64.MaxValue, generatedProperty.Validation.MaximumValue);
Assert.AreEqual(MaskType.Integer, generatedProperty.Mask);
}
示例4: DateTime_Default
public void DateTime_Default()
{
var codeGenerator = new CodeGenerator();
CodeGeneratorProperty generatedProperty = codeGenerator.GenerateFromType<DateTime>();
Assert.AreEqual(WidgetType.TextBox, generatedProperty.WidgetType);
Assert.AreEqual(DatabaseColumnType.DateTime, generatedProperty.DatabaseColumn.Type);
Assert.AreEqual(ValidationType.Range, generatedProperty.Validation.Type);
Assert.AreEqual(DateTime.MinValue, generatedProperty.Validation.MinimumValue);
Assert.AreEqual(DateTime.MaxValue, generatedProperty.Validation.MaximumValue);
Assert.AreEqual(MaskType.DateTime, generatedProperty.Mask);
}
示例5: Boolean_Default
public void Boolean_Default()
{
var codeGenerator = new CodeGenerator();
CodeGeneratorProperty generatedProperty = codeGenerator.GenerateFromType<Boolean>();
Assert.AreEqual(WidgetType.CheckBox, generatedProperty.WidgetType);
Assert.AreEqual(DatabaseColumnType.Bit, generatedProperty.DatabaseColumn.Type);
Assert.AreEqual(ValidationType.None, generatedProperty.Validation.Type);
Assert.AreEqual(MaskType.None, generatedProperty.Mask);
}