Ejemplo n.º 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);
            }
        }
        public TokenIntegrationTests(ServiceProviderFixture serviceProviderFixture)
        {
            this.clientFixture = new ClientFixture(serviceProviderFixture);
            var collection = new ServiceCollection();

            collection.AddHttpClient(DefaultClientNames.Authorization);
            this.provider = collection.BuildServiceProvider();
        }
Ejemplo n.º 3
0
        public void Test()
        {
            var fixture    = new ClientFixture();
            var configTest = new ConfigTest(fixture);

            configTest.LoadConfiguration();
            configTest.SetConfiguration();
            configTest.LoadReloadConfiguration();
            configTest.SetReloadConfiguration();
        }
Ejemplo n.º 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");
            }
        }
 /// <summary>
 /// Setup
 /// </summary>
 public GetSteamUsers_Tests(ClientFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetDotaTeam_Tests(ClientFixture fixture) : base(fixture)
 {
 }
 public IdentificationTypeClientTest(ClientFixture clientFixture)
     : base(clientFixture)
 {
     identificationTypeClient = new IdentificationTypeClient();
 }
Ejemplo n.º 8
0
 public CustomerClientTest(ClientFixture clientFixture)
     : base(clientFixture)
 {
     client          = new CustomerClient();
     cardTokenClient = new CardTokenTestClient();
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetItemIconPath_Tests(ClientFixture fixture) : base(fixture)
 {
 }
 public GetPlayerProfile_Tests(ClientFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 11
0
 public TokenIntegrationTests(ServiceProviderFixture serviceProviderFixture)
 {
     this.clientFixture = new ClientFixture(serviceProviderFixture);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetSteamFriendlists_Tests(ClientFixture fixture) : base(fixture)
 {
 }
 /// <summary>
 /// Setup
 /// </summary>
 public GetLeaderboard_Tests(ClientFixture fixture) : base(fixture)
 {
 }
 /// <summary>
 /// Setup
 /// </summary>
 public GetMatchDetails_Tests(ClientFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 15
0
 public void SetFixture(ClientFixture data)
 {
     Client = data.Client;
     OnTestInit();
 }
 /// <summary>
 /// Setup.
 /// </summary>
 public GetStoreMetadata_Tests(ClientFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetSteamAccountBans_Tests(ClientFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 18
0
 public EventsApiTests(ClientFixture <Startup> fixture)
 {
     Client = fixture.Client;
 }
 /// <summary>
 /// Setup
 /// </summary>
 public GetTournamentPlayerStats_Tests(ClientFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 20
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetPlayerItems_Tests(ClientFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Setup.
 /// </summary>
 public GetLeagueListing_Tests(ClientFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 22
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetAppNews_Tests(ClientFixture fixture) : base(fixture)
 {
 }
 /// <summary>
 /// Setup
 /// </summary>
 public GetSteamProducts_Tests(ClientFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 24
0
 public ListItemTests(ListItemFixture fixture)
 {
     _fixture = fixture;
     _client  = _fixture.Client;
 }
 /// <summary>
 /// Setup
 /// </summary>
 public GetTournamentPrizePool_Tests(ClientFixture fixture) : base(fixture)
 {
 }
 /// <summary>
 /// Setup
 /// </summary>
 public GetSchemaUrl_Tests(ClientFixture fixture) : base(fixture)
 {
 }
 /// <summary>
 /// Setup
 /// </summary>
 /// <param name="fixture"></param>
 public GetDotaTeamInfosById_Tests(ClientFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 28
0
 /// <summary>
 /// Setup
 /// </summary>
 public GetHeroes_Tests(ClientFixture fixture) : base(fixture)
 {
 }
 /// <summary>
 /// Setup
 /// </summary>
 public GetRecentDcpEvents_Tests(ClientFixture fixture) : base(fixture)
 {
 }
Ejemplo n.º 30
0
 public AdvancedPaymentClientTest(ClientFixture clientFixture)
     : base(clientFixture)
 {
     cardTokenClient = new CardTokenTestClient();
     client          = new AdvancedPaymentClient();
 }