1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
4
using ICSharpCode.WixBinding;
5
using ICSharpCode.XmlEditor;
8
using System.Xml.Schema;
10
namespace WixBinding.Tests.PackageFiles
13
public class WixSchemaTests
15
WixSchemaCompletion schema;
18
public void SetUpFixture()
20
schema = new WixSchemaCompletion();
24
public void DirectoryChildElements()
26
string[] childElements = schema.GetChildElements("Directory");
27
Assert.AreEqual(4, childElements.Length);
28
Assert.Contains("Component", childElements);
29
Assert.Contains("Directory", childElements);
30
Assert.Contains("Merge", childElements);
31
Assert.Contains("SymbolPath", childElements);
35
public void DirectoryElementAttributes()
37
string[] attributes = schema.GetAttributeNames("Directory");
38
Assert.IsTrue(attributes.Length > 0);
39
Assert.Contains("Id", attributes);
40
Assert.Contains("FileSource", attributes);
44
public void SrcAttributeExcluded()
46
string[] attributes = schema.GetAttributeNames("Directory");
47
Assert.IsTrue(attributes.Length > 0);
48
foreach (string attribute in attributes) {
49
Assert.IsFalse(attribute == "src");
54
public void UpgradeImageDeprecatedAttributes()
56
string[] attributes = schema.GetDeprecatedAttributes("UpgradeImage");
57
Assert.Contains("src", attributes);
58
Assert.Contains("srcPatch", attributes);
62
public void ProductAutogenuuidAttributeType()
64
QualifiedName attributeName = schema.GetAttributeType("Product", "Id");
65
Assert.AreEqual("AutogenGuid", attributeName.Name);
69
public void ComponentKeyPathAttributeValues()
71
string[] values = schema.GetAttributeValues("Component", "KeyPath");
72
Assert.AreEqual(2, values.Length);
73
Assert.Contains("yes", values);
74
Assert.Contains("no", values);