コード例 #1
0
        public void Set()
        {
            var source = new ThreadPrincipalSource();
            source.Value = new GenericPrincipal(new GenericIdentity("Identity"), new string[0]);

            Assert.Same(source.Value, Thread.CurrentPrincipal);
        }
コード例 #2
0
        public void Get()
        {
            Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity("Identity"), new string[0]);
            var source = new ThreadPrincipalSource();

            Assert.Same(Thread.CurrentPrincipal, source.Value);
        }
コード例 #3
0
        public void Get()
        {
            Thread.CurrentPrincipal = new GenericPrincipal(new GenericIdentity("Identity"), new string[0]);
            var source = new ThreadPrincipalSource();

            Assert.Same(Thread.CurrentPrincipal, source.Value);
        }
コード例 #4
0
        public void Set()
        {
            var source = new ThreadPrincipalSource();

            source.Value = new GenericPrincipal(new GenericIdentity("Identity"), new string[0]);

            Assert.Same(source.Value, Thread.CurrentPrincipal);
        }