Пример #1
0
        public void RefreshTokenIfNecessary_ThreadSafe()
        {
            vThreadedTest = new ThreadedTest();
            SetupMockAccessToken(NewFabOauthAccess(), vThreadedTest.MockEntryCallback);
            vThreadedTest.RunTest(ThreadRefreshIfNecc);

            MockOauth.Verify(x =>
                             x.AccessTokenClientCredentials.Get(
                                 It.IsAny <long>(),
                                 It.IsAny <string>(),
                                 It.IsAny <string>(),
                                 SessionType.App
                                 ),
                             Times.Once()
                             );
        }
Пример #2
0
        public void RequestAuthentication_ThreadSafe()
        {
            vThreadedTest = new ThreadedTest();
            SetupMockAccessToken(NewFabOauthAccess(), vThreadedTest.MockEntryCallback);
            vThreadedTest.RunTest(ThreadRequestAuth);

            MockOauth.Verify(x =>
                             x.AccessTokenClientCredentials.Get(
                                 It.IsAny <long>(),
                                 It.IsAny <string>(),
                                 It.IsAny <string>(),
                                 SessionType.App
                                 ),
                             Times.Exactly(2)
                             );
        }