public void ParseFieldWithQualifiedName() { var f = FieldModel.Parse(null, RoslynBuilder.DeclareField(typeof(GameObject), "a")); Assert.That(f, Is.Not.Null); Assert.AreEqual(typeof(GameObject), f.Type); }
public void ParseFieldWithConvertAttribute() { var f = FieldModel.Parse(null, RoslynBuilder.DeclareField(typeof(Entity), "a") .AddAttributeLists(SyntaxFactory.AttributeList().AddAttributes(SyntaxFactory.Attribute(SyntaxFactory.IdentifierName("Convert"))))); Assert.That(f, Is.Not.Null); Assert.AreEqual(typeof(GameObject), f.Type); }
public void ParseFieldWithHideInInspector() { var f1 = new FieldModel(null, typeof(int), "i") { HideInInspector = true }; var ast = f1.Generate(); var f2 = FieldModel.Parse(null, ast); Assert.IsTrue(f2.HideInInspector); }