public void Should_retrieve_value() { new CallContextStorage().SetValue("MyReallyAwesomeKey", "My Cool Value"); // Sanity Check var sameThreadValue = new CallContextStorage().GetValue <string>("MyReallyAwesomeKey"); sameThreadValue.ShouldBe("My Cool Value"); Console.WriteLine("Same thread value works fine"); var task = Task.Run(() => TestGetValue()); task.Wait(); }
private void TestGetValue() { var value = new CallContextStorage().GetValue <string>("MyReallyAwesomeKey"); value.ShouldBe("My Cool Value"); }