public async Task CreateDomainAsync_ExpectedResult()
        {
            var req = new CreateDomainRequest()
            {
                Name = "test-domain.co.uk"
            };

            var ops = new DomainOperations <Domain>(_client);
            await ops.CreateDomainAsync(req);

            await _client.Received().PostAsync("/ddosx/v1/domains", req);
        }
        public async Task UpdateDomainWAFRuleAsync_ExpectedResult()
        {
            var req = new UpdateWAFRuleRequest()
            {
                URI = "test.html"
            };

            var ops = new DomainWAFRuleOperations <WAFRule>(_client);
            await ops.UpdateDomainWAFRuleAsync("test-domain.co.uk", "00000000-0000-0000-0000-000000000000", req);

            await _client.Received()
            .PatchAsync($"/ddosx/v1/domains/test-domain.co.uk/waf/rules/00000000-0000-0000-0000-000000000000", req);
        }
        public async Task UpdateDomainRecordAsync_ExpectedResult()
        {
            var req = new UpdateRecordRequest()
            {
                Name = "test-record.test-domain.co.uk"
            };

            var ops = new DomainRecordOperations <Record>(_client);
            await ops.UpdateDomainRecordAsync("test-domain.co.uk", "00000000-0000-0000-0000-000000000000", req);

            await _client.Received()
            .PatchAsync($"/ddosx/v1/domains/test-domain.co.uk/records/00000000-0000-0000-0000-000000000000", req);
        }
Exemplo n.º 4
0
        public async Task CreateDomainWAFAsync_ExpectedResult()
        {
            var req = new CreateWAFRequest()
            {
                WAFMode       = "On",
                ParanoiaLevel = "Medium"
            };

            var ops = new DomainWAFOperations <WAF>(_client);
            await ops.CreateDomainWAFAsync("test-domain.co.uk", req);

            await _client.Received().PostAsync($"/ddosx/v1/domains/test-domain.co.uk/waf", req);
        }
Exemplo n.º 5
0
        public async Task UpdateDomainPropertyAsync_ExpectedResult()
        {
            var req = new UpdateDomainPropertyRequest()
            {
                Value = "test"
            };

            var ops = new DomainPropertyOperations <DomainProperty>(_client);
            await ops.UpdateDomainPropertyAsync("test-domain.co.uk", "00000000-0000-0000-0000-000000000000", req);

            await _client.Received()
            .PatchAsync($"/ddosx/v1/domains/test-domain.co.uk/properties/00000000-0000-0000-0000-000000000000", req);
        }
Exemplo n.º 6
0
        public async Task UpdateDomainWAFRuleSetAsync_ExpectedResult()
        {
            var req = new UpdateWAFRuleSetRequest()
            {
                Active = false
            };

            var ops = new DomainWAFRuleSetOperations <WAFRuleSet>(_client);
            await ops.UpdateDomainWAFRuleSetAsync("test-domain.co.uk", "00000000-0000-0000-0000-000000000000", req);

            await _client.Received()
            .PatchAsync($"/ddosx/v1/domains/test-domain.co.uk/waf/rulesets/00000000-0000-0000-0000-000000000000", req);
        }