public override void AddVariable <_T0>(string group, string name, Instrumentation.Variable <_T0> variable) { InstrumentationService.VariableHolder holder = GetToAdd <InstrumentationService.VariableHolder >(group, name, variableLock, variables); holder.var = variable; }
public virtual void VariableHolder() { InstrumentationService.VariableHolder <string> variableHolder = new InstrumentationService.VariableHolder <string>(); variableHolder.var = new _Variable_282(); JSONObject json = (JSONObject) new JSONParser().Parse(variableHolder.ToJSONString( )); NUnit.Framework.Assert.AreEqual(json.Count, 1); NUnit.Framework.Assert.AreEqual(json["value"], "foo"); StringWriter writer = new StringWriter(); variableHolder.WriteJSONString(writer); writer.Close(); json = (JSONObject) new JSONParser().Parse(writer.ToString()); NUnit.Framework.Assert.AreEqual(json.Count, 1); NUnit.Framework.Assert.AreEqual(json["value"], "foo"); }