Example #1
0
	public void TestSimplestAddChild()
	{

		code = "<ConsoleApp xmlns=\"console\" xmlns:x=\"http://schemas.microsoft.com/winfx/xaml/2005\">\n"+
			"<ConsoleWriter></ConsoleWriter>" +
			"</ConsoleApp>";
		ConsoleApp app = new ConsoleApp();
		ConsoleWriter writer = new ConsoleWriter();
		app.AddChild(writer);

		compare(app);
	}
Example #2
0
	public void TestObjectAsDependencyPropertyValue()
	{
		code = "<ConsoleApp xmlns=\"console\" xmlns:x=\"http://schemas.microsoft.com/winfx/xaml/2005\">\n"+
			"<ConsoleReader>\n" +
			"<ConsoleApp.Repetitions><ConsoleValueString Text=\"3\" /></ConsoleApp.Repetitions>\n" +
			"</ConsoleReader>\n" +
			"</ConsoleApp>";

		ConsoleApp app = new ConsoleApp();
		ConsoleReader reader = new ConsoleReader();
		app.AddChild(reader);
		ConsoleApp.SetRepetitions(reader, 3);
		
		compare(app);
	}
Example #3
0
	public void TestKeyAndStaticResource()
	{
		code = "<ConsoleApp xmlns=\"console\" xmlns:x=\"http://schemas.microsoft.com/winfx/xaml/2005\">\n"+
			"<ConsoleWriter Text=\"xyz\" x:Key=\"foobar\" />\n" +
			"<ConsoleReader Prompt=\"{StaticResource foobar}\" />\n" +
			"</ConsoleApp>";

		ConsoleApp app = new ConsoleApp();
		ConsoleWriter writer = new ConsoleWriter();
		writer.Text = new ConsoleValueString("xyz");
		app.AddChild(writer);
		ConsoleReader reader = new ConsoleReader();
		app.AddChild(reader);
		reader.Prompt = writer;
		
		compare(app);
	}
Example #4
0
	public void TestObjectAsPropertyValue()
	{
		code = "<ConsoleApp xmlns=\"console\" xmlns:x=\"http://schemas.microsoft.com/winfx/xaml/2005\">\n"+
		"<ConsoleReader>\n" +
		"<ConsoleReader.Prompt><ConsoleWriter /></ConsoleReader.Prompt>\n" +
		"</ConsoleReader>\n" +
		"</ConsoleApp>";
		ConsoleApp app = new ConsoleApp();
		ConsoleReader reader = new ConsoleReader();
		app.AddChild(reader);
		ConsoleWriter writer = new ConsoleWriter();
		reader.Prompt = writer;
		compare(app);
	}
Example #5
0
	public void TestDependencyProperty()
	{
		code = "<ConsoleApp xmlns=\"console\" xmlns:x=\"http://schemas.microsoft.com/winfx/xaml/2005\">\n"+
			"<ConsoleWriter ConsoleApp.Repetitions=\"3\" />" +
			"</ConsoleApp>";

		ConsoleApp app = new ConsoleApp();
		ConsoleWriter writer = new ConsoleWriter();
		ConsoleApp.SetRepetitions(writer, 3);
		app.AddChild(writer);

		compare(app);
	}
Example #6
0
	public void TestTextProperty()
	{
		code = "<ConsoleApp xmlns=\"console\" xmlns:x=\"http://schemas.microsoft.com/winfx/xaml/2005\">\n"+
			"<ConsoleWriter Text=\"Hello\" />" +
			"</ConsoleApp>";

		ConsoleApp app = new ConsoleApp();
		ConsoleWriter writer = new ConsoleWriter();
		writer.Text = new ConsoleValueString("Hello");
		app.AddChild(writer);

		compare(app);							
	}