コード例 #1
0
        /// <summary>
        /// Setup a server and client fixture.
        /// </summary>
        /// <param name="writer">The test output writer.</param>
        public async Task OneTimeSetUpAsync(TextWriter writer = null)
        {
            // pki directory root for test runs.
            m_pkiRoot = Path.GetTempPath() + Path.GetRandomFileName();

            // start Ref server
            m_serverFixture = new ServerFixture <ReferenceServer> {
                UriScheme    = m_uriScheme,
                SecurityNone = true,
                AutoAccept   = true
            };
            if (writer != null)
            {
                m_serverFixture.TraceMasks = Utils.TraceMasks.All;
            }
            m_server = await m_serverFixture.StartAsync(writer ?? TestContext.Out, m_pkiRoot).ConfigureAwait(false);

            m_clientFixture = new ClientFixture();
            await m_clientFixture.LoadClientConfiguration(m_pkiRoot).ConfigureAwait(false);

            m_clientFixture.Config.TransportQuotas.MaxMessageSize    =
                m_clientFixture.Config.TransportQuotas.MaxBufferSize = 4 * 1024 * 1024;
            m_url = new Uri(m_uriScheme + "://localhost:" + m_serverFixture.Port.ToString());
            try
            {
                m_session = await m_clientFixture.ConnectAsync(m_url, SecurityPolicies.Basic256Sha256).ConfigureAwait(false);
            }
            catch (Exception e)
            {
                Assert.Ignore("OneTimeSetup failed to create session, tests skipped. Error: {0}", e.Message);
            }
        }
コード例 #2
0
        public TokenIntegrationTests(ServiceProviderFixture serviceProviderFixture)
        {
            this.clientFixture = new ClientFixture(serviceProviderFixture);
            var collection = new ServiceCollection();

            collection.AddHttpClient(DefaultClientNames.Authorization);
            this.provider = collection.BuildServiceProvider();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: fs7744/pandv.config
        public void Test()
        {
            var fixture    = new ClientFixture();
            var configTest = new ConfigTest(fixture);

            configTest.LoadConfiguration();
            configTest.SetConfiguration();
            configTest.LoadReloadConfiguration();
            configTest.SetReloadConfiguration();
        }
コード例 #4
0
        /// <summary>
        /// Setup.
        /// </summary>
        public GetRealtimeMatchStats_Tests(ClientFixture fixture) : base(fixture)
        {
            var response = DotaApiClient.GetTopLiveGamesAsync()
                           .Result;

            SleepAfterSendingRequest();
            if (response.Successful)
            {
                _liveMatchServerIds = response.Contents
                                      .Where(m => m.ServerSteamId != 0)
                                      .Select(m => m.ServerSteamId)
                                      .Take(5)
                                      .ToList();
                if (_liveMatchServerIds.Count == 0)
                {
                    throw new Exception("Can't get live matches from api");
                }
            }
            else
            {
                throw new Exception("Can't get live matches from api");
            }
        }
コード例 #5
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetSteamUsers_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #6
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetDotaTeam_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #7
0
 public IdentificationTypeClientTest(ClientFixture clientFixture)
     : base(clientFixture)
 {
     identificationTypeClient = new IdentificationTypeClient();
 }
コード例 #8
0
 public CustomerClientTest(ClientFixture clientFixture)
     : base(clientFixture)
 {
     client          = new CustomerClient();
     cardTokenClient = new CardTokenTestClient();
 }
コード例 #9
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetItemIconPath_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #10
0
 public GetPlayerProfile_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #11
0
 public TokenIntegrationTests(ServiceProviderFixture serviceProviderFixture)
 {
     this.clientFixture = new ClientFixture(serviceProviderFixture);
 }
コード例 #12
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetSteamFriendlists_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #13
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetLeaderboard_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #14
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetMatchDetails_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #15
0
 public void SetFixture(ClientFixture data)
 {
     Client = data.Client;
     OnTestInit();
 }
コード例 #16
0
 /// <summary>
 /// Setup.
 /// </summary>
 public GetStoreMetadata_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #17
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetSteamAccountBans_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #18
0
 public EventsApiTests(ClientFixture <Startup> fixture)
 {
     Client = fixture.Client;
 }
コード例 #19
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetTournamentPlayerStats_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #20
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetPlayerItems_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #21
0
 /// <summary>
 /// Setup.
 /// </summary>
 public GetLeagueListing_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #22
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetAppNews_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #23
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetSteamProducts_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #24
0
 public ListItemTests(ListItemFixture fixture)
 {
     _fixture = fixture;
     _client  = _fixture.Client;
 }
コード例 #25
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetTournamentPrizePool_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #26
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetSchemaUrl_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #27
0
 /// <summary>
 /// Setup
 /// </summary>
 /// <param name="fixture"></param>
 public GetDotaTeamInfosById_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #28
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetHeroes_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #29
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetRecentDcpEvents_Tests(ClientFixture fixture) : base(fixture)
 {
 }
コード例 #30
0
 public AdvancedPaymentClientTest(ClientFixture clientFixture)
     : base(clientFixture)
 {
     cardTokenClient = new CardTokenTestClient();
     client          = new AdvancedPaymentClient();
 }