public void CreateField_EnsureValidName() { var xml = XDocument.Parse("<field name=\"_3DES_EDE_CBC\" />"); var field = XmlApiImporter.CreateField(xml.Root); Assert.AreEqual("_3desEdeCbc", field.Name); }
public void CreateField_HandleDollarSignNumber() { var xml = XDocument.Parse("<field name=\"$3\" />"); var field = XmlApiImporter.CreateField(xml.Root); Assert.AreEqual("_3", field.Name); }
public void CreateField_StudlyCaseName() { var xml = XDocument.Parse("<field name=\"_DES_EDE_CBC\" />"); var field = XmlApiImporter.CreateField(xml.Root); Assert.AreEqual("DesEdeCbc", field.Name); }
public void CreateField_HandleDollarSign() { var klass = new TestClass("object", "MyNamespace.MyType"); var xml = XDocument.Parse("<field name=\"A$3\" />"); var field = XmlApiImporter.CreateField(klass, xml.Root); Assert.AreEqual("A_3", field.Name); }
public void CreateField_EnsureValidName() { var klass = new TestClass("object", "MyNamespace.MyType"); var xml = XDocument.Parse("<field name=\"_3DES_EDE_CBC\" />"); var field = XmlApiImporter.CreateField(klass, xml.Root); Assert.AreEqual("_3desEdeCbc", field.Name); }
public void CreateField_CorrectApiVersion() { var klass = new TestClass("object", "MyNamespace.MyType"); var xml = XDocument.Parse("<field name='$3' api-since='7' />"); var field = XmlApiImporter.CreateField(klass, xml.Root); Assert.AreEqual(7, field.ApiAvailableSince); }
public void Field() { var element = package.Element("class"); var @class = XmlApiImporter.CreateClass(package, element); var field = XmlApiImporter.CreateField(element.Element("field")); Assert.IsTrue(field.Validate(options, new GenericParameterDefinitionList(), new CodeGeneratorContext()), "field.Validate failed!"); Assert.AreEqual("Value", field.Name); Assert.AreEqual("value", field.JavaName); Assert.AreEqual("1234", field.Value); Assert.AreEqual("int", field.TypeName); Assert.IsTrue(field.IsStatic); Assert.IsTrue(field.IsConst); }