public void TestGetSetDataOnDifferentThreads() { string id = "TestID-{82AC4E65-CC86-4BF0-95EA-AE4B2B5E4A35}"; string testString = "This is a test"; SerializableSring ssString = new SerializableSring(testString); DSNodeServices.TraceUtils.SetTraceData(id, ssString); ssString = null; bool test = false; Thread th = new Thread( () => { SerializableSring ret = (SerializableSring)DSNodeServices.TraceUtils.GetTraceData(id); test = ret == null; } ); th.Start(); th.Join(); Assert.IsTrue(test); }
public void TestGetSetData() { string id = "TestID-{82AC4E65-CC86-4BF0-95EA-AE4B2B5E4A35}"; string testString = "This is a test"; SerializableSring ssString = new SerializableSring(testString); DSNodeServices.TraceUtils.SetTraceData(id, ssString); ssString = null; SerializableSring ret = (SerializableSring)DSNodeServices.TraceUtils.GetTraceData(id); Assert.IsTrue(ret.Payload.Equals(testString)); }