public void TestInitialize() { _context = new ComponentContext(); _context.Configuration.DisableAttributeChecking = true; _context.Register(typeof(ComponentOne)); _context.SetVariableValue("one", "someString"); _context.SetVariableValue("two", 5); }
public void GetAPreviouslySetAndUnset() { _context.SetVariableValue("variable", null); var v = _context.GetVariable("variable"); Assert.IsNull(v); }
public void SetDirectValue() { _context.SetVariableValue("variable", "variableValue"); var v = _context.GetVariable("variable"); Assert.IsNotNull(v); Assert.IsInstanceOfType(v, typeof(string)); Assert.AreEqual(v, "variableValue"); }
static void Main() { var context = new ComponentContext(); context.ProcessCompositionXmlFromResource("Compositional.Composer.Samples.Basic.CalculatorComposition.xml"); context.SetVariableValue("Verbose", true); context.GetComponent <IProgramRunner>().Run(); }
public void OptNamedConfigProvidedByVar() { _context.Register(typeof(ComponentWithOptionalNamedConfig)); _context.SetVariableValue("someVariable", "SomeConfigValue"); var c = _context.GetComponent <ComponentWithOptionalNamedConfig>(); Assert.IsNotNull(c); Assert.IsNotNull(c.SomeConfig); Assert.AreEqual(c.SomeConfig, "SomeConfigValue"); }
public void GetVariableValue() { var vLazy = _context.LazyGetVariable("varName"); _context.SetVariableValue("varName", "varValue"); var v = vLazy.Value; Assert.IsNotNull(v); Assert.AreEqual(v, "varValue"); }
public void TestInitialize() { _context = new ComponentContext(); _context.SetVariableValue("SomeConfigurationPoint", "SomeConfigurationValue"); }
public void TestInitialize() { _context = new ComponentContext(); _context.SetVariableValue("variable", "variableValue"); }