public void Init()
		{
			SD.InitializeForUnitTests();
			textEditor = new MockTextEditor();
			MockTextEditorViewContent viewContent = new MockTextEditorViewContent();
			viewContent.TextEditor = textEditor;
			viewContent.SetFileName(@"d:\projects\test\file.wxs");
			
			workbench = new MockWorkbench();
			workbench.ViewContentCollection.Add(viewContent);
			
			MockTextEditorOptions textEditorOptions = new MockTextEditorOptions();
			MockXmlTextWriter xmlTextWriter = new MockXmlTextWriter(textEditorOptions);
			WixProject project = WixBindingTestsHelper.CreateEmptyWixProject();
			document = new WixDocument(project, new DefaultFileLoader());
			document.LoadXml(GetWixXml());
			document.FileName = @"d:\projects\test\File.wxs";
			textEditor.Document.Text = GetWixXml();
			
			MockWixPackageFilesControl packageFilesControl = new MockWixPackageFilesControl();
			packageFilesView = new PackageFilesView(project, workbench, packageFilesControl, xmlTextWriter);
			
			packageFilesControl.IsDirty = true;
			AddNewChildElementsToDirectory();
			packageFilesView.Write(document);
		}
		public void WixDocumentGetXmlWithSpaces()
		{
			MockTextEditorOptions options = new MockTextEditorOptions();
			options.ConvertTabsToSpaces = true;
			options.IndentationSize = 4;
			
			WixTextWriter wixWriter = new WixTextWriter(options);
			
			string outputXml = dialogElement.GetXml(wixWriter);
			string expectedXml = 
				"<Dialog Id=\"id\" Height=\"270\" Width=\"370\" Title=\"title\">\r\n" +
				"    <Control />\r\n" +
				"</Dialog>";
			Assert.AreEqual(expectedXml, outputXml);
		}
		public void Init()
		{
			project = WixBindingTestsHelper.CreateEmptyWixProject();
			mockWorkbench = new MockWorkbench();
			mockPackageFilesControl = new MockWixPackageFilesControl();
			textEditorOptions = new MockTextEditorOptions();
			textEditorOptions.ConvertTabsToSpaces = false;
			
			xmlTextWriter = new MockXmlTextWriter(textEditorOptions);
			packageFilesView = new PackageFilesView(project, mockWorkbench, mockPackageFilesControl, xmlTextWriter);
			
			mockWorkbench.ActiveContent = packageFilesView;
			
			document = new WixDocument(project, new DefaultFileLoader());
		}
		public void Init()
		{
			WixProject project = WixBindingTestsHelper.CreateEmptyWixProject();
			document = new WixDocument(project, new DefaultFileLoader());
			string xml = "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'><Product Name='MySetup'></Product></Wix>";
			document.LoadXml(xml);
			
			MockTextEditorOptions options = new MockTextEditorOptions();
			options.ConvertTabsToSpaces = false;
			options.IndentationSize = 1;
			
			WixTextWriter wixWriter = new WixTextWriter(options);
			xmlBuilder = new StringBuilder();
			xmlWriter = wixWriter.Create(new StringWriter(xmlBuilder));
			document.Save(xmlWriter);
		}
		public void XmlWriterSettingsIndentCharsIsTabTakenFromSaveMethod()
		{
			int indentLength = 3;
			string indent = " ".PadRight(indentLength);
			
			MockTextEditorOptions options = new MockTextEditorOptions();
			options.ConvertTabsToSpaces = true;
			options.IndentationSize = indentLength;
			
			WixTextWriter wixWriter = new WixTextWriter(options);
			xmlWriter = wixWriter.Create(new StringWriter(new StringBuilder()));
			
			Assert.AreEqual(indent, xmlWriter.Settings.IndentChars);
		}