public void WriteClasses_PassInRDOObjectWithTextField_ReturnsInheritRDOWrapper() { //ARRANGE var text = Writer.WriteClassMetaData(new Application { Objects = new List <ObjectDef> { new ObjectDef { Name = "hello", Fields = new List <Field>() { new Field { Name = "test", FieldType = FieldTypes.FixedLength, MaxLength = 30 } } } } }); //ACT var classDefinition = ParseTestHelper.GetClassDefinition(text); //ASSERT var fieldDef = classDefinition.Members.First().ToString().Trim(); Assert.Equal("public const int MAX_LENTH = 30;", fieldDef); }
public static IEnumerable <PropertyDeclarationSyntax> GetProperties(string text) { return(((CompilationUnitSyntax)ParseTestHelper.GetClassDefinition(text).Parent) .Members .Where(x => x is PropertyDeclarationSyntax) .Cast <PropertyDeclarationSyntax>()); }
public void WriteClasses_PassInRDOObject_ReturnsCorrectClassName() { //ARRANGE var text = Writer.WriteClasses(new Application { Objects = new List <ObjectDef> { new ObjectDef { Name = "hello", Fields = new List <Field>() } } }); //ACT var classDefinition = ParseTestHelper.GetClassDefinition(text); //ASSERT Assert.Equal("hello", classDefinition.Identifier.Text); }
public void WriteClasses_PassInRDOObject_ReturnsInheritRDOWrapper() { //ARRANGE var text = Writer.WriteClasses(new Application { Objects = new List <ObjectDef> { new ObjectDef { Name = "hello", Fields = new List <Field>() } } }); //ACT var classDefinition = ParseTestHelper.GetClassDefinition(text); //ASSERT var classDef = ((IdentifierNameSyntax)classDefinition.BaseList.Types[0].Type); Assert.Equal("RDOWrapper", classDef.Identifier.Text); }