コード例 #1
0
ファイル: DNSimple.cs プロジェクト: san983/dnsimple-csharp
 /// <summary>
 /// Initializes all the services offered by the current version of
 /// this API.
 /// </summary>
 /// <see cref="IdentityService"/>
 /// <see cref="HttpService"/>
 /// <see cref="OAuth2Service"/>
 private void InitializeServices()
 {
     Accounts     = new AccountsService(this);
     Certificates = new CertificatesService(this);
     Domains      = new DomainsService(this);
     Http         = new HttpService(RestClientWrapper.RestClient,
                                    new RequestBuilder());
     Identity  = new IdentityService(this);
     OAuth     = new OAuth2Service(Http);
     Registrar = new RegistrarService(this);
     Tlds      = new TldsService(this);
     Zones     = new ZonesService(this);
 }
コード例 #2
0
        public MockDnsimpleClient(string fixture)
        {
            Fixture = fixture;

            Accounts     = new AccountsService(this);
            Certificates = new CertificatesService(this);
            Domains      = new DomainsService(this);
            Http         = new MockHttpService("v2", Fixture, BaseUrl);
            Identity     = new IdentityService(this);
            OAuth        = new OAuth2Service(Http);
            Registrar    = new RegistrarService(this);
            Tlds         = new TldsService(this);
            Zones        = new ZonesService(this);
        }
コード例 #3
0
 /// <summary>
 /// Initializes all the services offered by the current version of
 /// this API.
 /// </summary>
 /// <see cref="IdentityService"/>
 /// <see cref="HttpService"/>
 /// <see cref="OAuth2Service"/>
 private void InitializeServices()
 {
     Http              = new HttpService(RestClientWrapper.RestClient, new RequestBuilder());
     Accounts          = new AccountsService(this);
     Certificates      = new CertificatesService(this);
     Contacts          = new ContactsService(this);
     Domains           = new DomainsService(this);
     Identity          = new IdentityService(this);
     OAuth             = new OAuth2Service(Http);
     Registrar         = new RegistrarService(this);
     Services          = new ServicesService(this);
     Tlds              = new TldsService(this);
     Templates         = new TemplatesService(this);
     VanityNameServers = new VanityNameServersService(this);
     Webhooks          = new WebhooksService(this);
     Zones             = new ZonesService(this);
 }
コード例 #4
0
        public CertificatesServiceTests()
        {
            var options = new DbContextOptionsBuilder <TrainConnectedDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;
            var dbContext = new TrainConnectedDbContext(options);

            AutoMapperConfig.RegisterMappings(new[]
            {
                typeof(ErrorViewModel).GetTypeInfo().Assembly,
                typeof(WorkoutActivityEditInputModel).GetTypeInfo().Assembly,
            });

            this.certificatesRepository    = new EfRepository <Certificate>(dbContext);
            this.usersRepository           = new EfRepository <TrainConnectedUser>(dbContext);
            this.workoutActivityRepository = new EfRepository <WorkoutActivity>(dbContext);

            this.certificatesService = new CertificatesService(this.certificatesRepository, this.usersRepository, this.workoutActivityRepository);
        }
コード例 #5
0
        public MockDnsimpleClient(string fixture)
        {
            Fixture   = fixture;
            UserAgent = "Testing user agent";

            Accounts          = new AccountsService(this);
            Certificates      = new CertificatesService(this);
            Contacts          = new ContactsService(this);
            Domains           = new DomainsService(this);
            Http              = new MockHttpService("v2", Fixture, BaseUrl);
            Identity          = new IdentityService(this);
            OAuth             = new OAuth2Service(Http);
            Registrar         = new RegistrarService(this);
            Services          = new ServicesService(this);
            Tlds              = new TldsService(this);
            Templates         = new TemplatesService(this);
            VanityNameServers = new VanityNameServersService(this);
            Webhooks          = new WebhooksService(this);
            Zones             = new ZonesService(this);
        }