public void TestBasicString() { _fakeTaskDll = XamlTestHelpers.SetupGeneratedCode(); object obj = _fakeTaskDll.CreateInstance("XamlTaskNamespace.FakeTask"); XamlTestHelpers.SetProperty(obj, "BasicString", "Enum1"); Dictionary <string, CommandLineToolSwitch> switchList = (Dictionary <string, CommandLineToolSwitch>)XamlTestHelpers.GetProperty(obj, "ActiveToolSwitches"); Assert.NotNull(switchList); string CommandLineToolSwitchOutput = switchList["BasicString"].SwitchValue; Assert.Equal("/Bs1", CommandLineToolSwitchOutput); obj = _fakeTaskDll.CreateInstance("XamlTaskNamespace.FakeTask"); XamlTestHelpers.SetProperty(obj, "BasicString", "Enum2"); switchList = (Dictionary <string, CommandLineToolSwitch>)XamlTestHelpers.GetProperty(obj, "ActiveToolSwitches"); Assert.NotNull(switchList); CommandLineToolSwitchOutput = switchList["BasicString"].SwitchValue; Assert.Equal("/Bs2", CommandLineToolSwitchOutput); }
public void TestBasicStringArray() { _fakeTaskDll = XamlTestHelpers.SetupGeneratedCode(); object obj = _fakeTaskDll.CreateInstance("XamlTaskNamespace.FakeTask"); XamlTestHelpers.SetProperty(obj, "BasicStringArray", new string[1]); Dictionary <string, CommandLineToolSwitch> switchList = (Dictionary <string, CommandLineToolSwitch>)XamlTestHelpers.GetProperty(obj, "ActiveToolSwitches"); Assert.NotNull(switchList); string toolSwitchValue = switchList["BasicStringArray"].SwitchValue; Assert.Equal("/Bsa", toolSwitchValue); }
public void TestBasicNonreversible() { _fakeTaskDll = XamlTestHelpers.SetupGeneratedCode(); object obj = _fakeTaskDll.CreateInstance("XamlTaskNamespace.FakeTask"); XamlTestHelpers.SetProperty(obj, "BasicNonreversible", true); Dictionary <string, CommandLineToolSwitch> switchList = (Dictionary <string, CommandLineToolSwitch>)XamlTestHelpers.GetProperty(obj, "ActiveToolSwitches"); Assert.NotNull(switchList); bool booleanValue = switchList["BasicNonreversible"].BooleanValue; Assert.True(booleanValue, "Actual BooleanValue is " + booleanValue.ToString()); string toolSwitchValue = switchList["BasicNonreversible"].SwitchValue; Assert.Equal("/Bn", toolSwitchValue); }
public void TestBasicReversibleFalse() { _fakeTaskDll = XamlTestHelpers.SetupGeneratedCode(); object obj = _fakeTaskDll.CreateInstance("XamlTaskNamespace.FakeTask"); XamlTestHelpers.SetProperty(obj, "BasicReversible", false); Dictionary <string, CommandLineToolSwitch> switchList = (Dictionary <string, CommandLineToolSwitch>)XamlTestHelpers.GetProperty(obj, "ActiveToolSwitches"); Assert.NotNull(switchList); bool booleanValue = switchList["BasicReversible"].BooleanValue; string toolSwitchValue; if (booleanValue) { toolSwitchValue = switchList["BasicReversible"].SwitchValue; } else { toolSwitchValue = switchList["BasicReversible"].ReverseSwitchValue; } Assert.Equal("/BrF", toolSwitchValue); }
public void TestQuotingBackslashes() { _fakeTaskDll = XamlTestHelpers.SetupGeneratedCode(XamlTestHelpers.QuotingBackslashXml); object obj = _fakeTaskDll.CreateInstance("XamlTaskNamespace.FakeTask"); }
public void TestBasicInteger() { _fakeTaskDll = XamlTestHelpers.SetupGeneratedCode(); object obj = _fakeTaskDll.CreateInstance("XamlTaskNamespace.FakeTask"); XamlTestHelpers.SetProperty(obj, "BasicInteger", 1); Dictionary <string, CommandLineToolSwitch> switchList = (Dictionary <string, CommandLineToolSwitch>)XamlTestHelpers.GetProperty(obj, "ActiveToolSwitches"); Assert.NotNull(switchList); string CommandLineToolSwitchOutput = switchList["BasicInteger"].SwitchValue + switchList["BasicInteger"].Separator + switchList["BasicInteger"].Number; Assert.Equal(CommandLineToolSwitchOutput, "/Bi1"); }
public void TestBasicDirectory() { _fakeTaskDll = XamlTestHelpers.SetupGeneratedCode(); object obj = _fakeTaskDll.CreateInstance("XamlTaskNamespace.FakeTask"); XamlTestHelpers.SetProperty(obj, "BasicDirectory", "FakeDirectory"); Dictionary <string, CommandLineToolSwitch> switchList = (Dictionary <string, CommandLineToolSwitch>)XamlTestHelpers.GetProperty(obj, "ActiveToolSwitches"); Assert.NotNull(switchList); string toolSwitchValue = switchList["BasicDirectory"].SwitchValue; Assert.True(String.IsNullOrEmpty(toolSwitchValue), "Expected nothing, got " + toolSwitchValue); }