public void GetList_ShouldContainTheTestDomain()
        {
            DomainListResult result = _api.Domains.GetList();

            Assert.IsTrue(result.Domains.Length > 0);
            Assert.IsTrue(result.Domains.Any(d => string.Equals(d.Name, _domainName)));
        }
        public void GetList_TestForAllParamsMethodShouldContainTheTestDomain()
        {
            string           searchTerm = _domainName.Substring(0, (_domainName.Length - 4)); // for the .com TLD
            DomainListResult result     = _api.Domains.GetList("ALL", searchTerm, 1, 21, "NAME");

            Assert.IsTrue(result.Domains.Length > 0);
            Assert.IsTrue(result.Domains.Any(d => string.Equals(d.Name, _domainName)));
        }
Exemplo n.º 3
0
        public async Task <DomainListResult> DomainList(DomainListRequestParam param)
        {
            try
            {
                DomainListResult result = await HttpRequest <DomainListResult>(param);

                return(result);
            }
            catch (Exception ex)
            {
                throw new Exception($"Tencent cloud ddns request error. {ex.Message}");
            }
        }
        public async Task <Response <DomainListResult> > ListAsync(string filter = null, CancellationToken cancellationToken = default)
        {
            using var message = CreateListRequest(filter);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

            switch (message.Response.Status)
            {
            case 200:
            {
                DomainListResult value = default;
                using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);

                value = DomainListResult.DeserializeDomainListResult(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }
        public void GetList_ShouldContainMoreThan20Domains()
        {
            DomainListResult result = _api.Domains.GetList(1, 21);

            Assert.IsTrue(result.Domains.Length > 20);
        }