public void NewFieldTest() { DataTypeDefinitionFactoryBase _newInstance = new DataTypeDefinitionFactoryBase(x => { }) { }; IDataTypeFieldFactory _newField = _newInstance.NewField(); XML.DataTypeDesign _dataType = _newInstance.Export(); Assert.IsNotNull(_dataType); Assert.IsNotNull(_dataType.Fields); Assert.AreEqual <int>(1, _dataType.Fields.Count()); }
public void ConstructorTest() { DataTypeDefinitionFactoryBase _newInstance = new DataTypeDefinitionFactoryBase(x => { }) { IsOptionSet = true, IsUnion = true, //Is not supported by the UA Model Design Name = new XmlQualifiedName("XmlQualifiedName"), // Is not supported by the UA Model Design SymbolicName = "SymbolicName" // Is not supported by the UA Model Design }; XML.DataTypeDesign _dataType = _newInstance.Export(); Assert.IsNotNull(_dataType); Assert.IsNotNull(_dataType.Fields); Assert.AreEqual <int>(0, _dataType.Fields.Count()); Assert.IsNull(_dataType.Encodings); Assert.IsTrue(_dataType.IsOptionSet); Assert.IsFalse(_dataType.NoArraysAllowed); }
//IDataTypeFactory public IDataTypeDefinitionFactory NewDefinition() { Debug.Assert(m_DataTypeDefinitionFactoryBase == null); m_DataTypeDefinitionFactoryBase = new DataTypeDefinitionFactoryBase(TraceEvent); return(m_DataTypeDefinitionFactoryBase); }