+
+ CallContext.FreeNamedDataSlot ("testlc");
+ }
+
+ [Test]
+ [Category("MobileNotWorking")]
+ public void LogicalGetData_SetData()
+ {
+ var value = "a";
+
+ CallContext.SetData ("testlc", value);
+ var capturedValue = CallContext.LogicalGetData ("testlc");
+
+ Assert.IsNull (capturedValue);
+ }
+
+ [Test]
+ [Category("MobileNotWorking")]
+ public void LogicalGetData_SetDataLogicalThreadAffinative()
+ {
+ var value = new CallContextValue ("a");
+
+ CallContext.SetData ("testlc", value);
+ var capturedValue = CallContext.LogicalGetData ("testlc");
+
+ Assert.AreEqual (value, capturedValue);
+ }
+
+ [Test]
+ [Category("MobileNotWorking")]
+ public void GetData_SetLogicalData()
+ {
+ var value = "a";
+
+ CallContext.LogicalSetData ("testlc", value);
+ var capturedValue = CallContext.GetData ("testlc");
+
+ Assert.AreEqual (value, capturedValue);
+ }
+
+ [Test]
+ [Category("MobileNotWorking")]
+ public void CaptureLogicalCallContext()
+ {
+ var value = "Tester";
+ object capturedValue = null;
+
+ CallContext.LogicalSetData ("testlc", value);
+
+ ExecutionContext ec = ExecutionContext.Capture ();
+ Assert.IsNotNull (ec, "Capture");
+ Assert.AreEqual (value, CallContext.LogicalGetData ("testlc"));
+ CallContext.LogicalSetData ("testlc", null);
+
+ ExecutionContext.Run (ec, new ContextCallback (new Action<object> ((data) => {
+ capturedValue = CallContext.LogicalGetData ("testlc");
+ })), null);
+
+ Assert.AreEqual (value, capturedValue);
+ Assert.AreNotEqual (value, CallContext.LogicalGetData ("testlc"));
+ }
+
+ [Test]
+ [Category ("MobileNotWorking")]
+ public void CaptureCallContext ()
+ {
+ var value = new CallContextValue (true);
+ object capturedValue = null;
+
+ CallContext.SetData ("testlc", value);
+
+ ExecutionContext ec = ExecutionContext.Capture ();
+ Assert.IsNotNull (ec, "Capture");
+ Assert.AreEqual (value, CallContext.GetData ("testlc"));
+ CallContext.SetData ("testlc", null);
+
+ ExecutionContext.Run (ec, new ContextCallback (new Action<object> ((data) => {
+ capturedValue = CallContext.GetData ("testlc");
+ })), null);
+
+ Assert.AreEqual (value, capturedValue);
+ Assert.AreNotEqual (value, CallContext.GetData ("testlc"));