예제 #1
0
        public void WebAPI_DomainServiceGetFromMongo_Test()
        {
            DomainsService ds   = new DomainsService();
            List <Domain>  dmns = ds.GetFromMongo(5, "TestSource");

            Assert.AreEqual(10, dmns.Count);
        }
예제 #2
0
        public void WebAPI_DomainServiceGet_Test()
        {
            DomainsService ds   = new DomainsService();
            List <Domain>  dmns = ds.Get(10);

            Assert.AreEqual(10, dmns.Count);
        }
예제 #3
0
 public DomainEditorDialogViewModel(
     DomainPropertyService domainPropertyService,
     DomainsService domainsService)
 {
     _domains = domainsService;
     _domainPropertyService = domainPropertyService;
 }
        public MockDnsimpleClient(string fixture)
        {
            Fixture = fixture;

            Accounts  = new AccountsService(this);
            Domains   = new DomainsService(this);
            Http      = new MockHttpService("v2", Fixture, BaseUrl);
            Identity  = new IdentityService(this);
            OAuth     = new OAuth2Service(Http);
            Registrar = new RegistrarService(this);
            Zones     = new ZonesService(this);
        }
예제 #5
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()
 {
     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);
 }
예제 #6
0
        private DomainsService GetInMemoryDomainsService()
        {
            DbContextOptions <AppDbContext> options;
            var builder = new DbContextOptionsBuilder <AppDbContext>();

            builder.UseInMemoryDatabase("domains-test");
            options = builder.Options;
            var db = new AppDbContext(options);

            db.Database.EnsureDeleted();
            db.Database.EnsureCreated();

            var properties = new DomainPropertyService(db);
            var domains    = new DomainsService(db, properties);

            return(domains);
        }
예제 #7
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);
 }
예제 #8
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);
        }
예제 #9
0
 public DomainsServiceTests()
 {
     service = new DomainsService(db);
 }
 public DomainsViewerViewModel(DomainsService domainsService, IDialogService dialogService)
 {
     _domains       = domainsService;
     _dialogService = dialogService;
 }