Пример #1
0
            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();
            }
Пример #2
0
            private void TestGetValue()
            {
                var value = new CallContextStorage().GetValue <string>("MyReallyAwesomeKey");

                value.ShouldBe("My Cool Value");
            }