public void DefaultValuesTest() { ModelDesign _default = OpcUaModelCompilerModelDesigner.GetDefault(); Assert.IsNotNull(_default); Assert.IsNull(_default.AnyAttr); Assert.IsFalse(string.IsNullOrEmpty(_default.DefaultLocale)); Assert.AreEqual <string>("en", _default.DefaultLocale); Assert.IsNull(_default.Items); Assert.IsNotNull(_default.Namespaces); Assert.AreEqual <int>(2, _default.Namespaces.Length); Assert.IsFalse(string.IsNullOrEmpty(_default.TargetNamespace)); Assert.AreEqual <string>("http://cas.eu/UA/CommServer/", _default.TargetNamespace); Assert.IsFalse(_default.TargetPublicationDateSpecified); Assert.IsTrue(string.IsNullOrEmpty(_default.TargetVersion)); Assert.IsNull(_default.TargetXmlNamespace); Assert.AreEqual <string>("OpcUa", _default.Namespaces[1].Name); Assert.AreEqual <string>("Opc.Ua", _default.Namespaces[1].Prefix); Assert.AreEqual <string>(@"http://opcfoundation.org/UA/", _default.Namespaces[1].Value); Assert.AreEqual <string>(@"http://opcfoundation.org/UA/2008/02/Types.xsd", _default.Namespaces[1].XmlNamespace); }
/// <summary> /// Creates new model encapsulated by an instance of this class /// </summary> /// <param name="solution">The solution description.</param> /// <param name="gui">The graphical user interface.</param> /// <param name="projectName">Name of the project.</param> /// <returns><see cref="IProjectConfigurationManagement"/>.</returns> internal static IProjectConfigurationManagement CreateNew(ISolutionConfigurationManagement solution, IGraphicalUserInterface gui, string projectName) { if (solution == null) { throw new ArgumentNullException(nameof(solution)); } if (gui == null) { throw new ArgumentNullException(nameof(gui)); } UAModelDesignerProject _projectDescription = UAModelDesignerProject.CreateEmpty(projectName); //TODO Creating new project the existing one should not be overridden #174 string _defFilePath = Path.ChangeExtension(RelativeFilePathsCalculator.CalculateAbsoluteFileName(solution.DefaultDirectory, projectName), Resources.Project_FileDialogDefaultExt); return(new ProjectConfigurationManagement(true, _projectDescription, solution, new Tuple <OpcUaModelCompiler.ModelDesign, string>(OpcUaModelCompilerModelDesigner.GetDefault(), _defFilePath), gui)); }