public async Task CreateDomainWAFAdvancedRuleAsync_InvalidDomainName_ThrowsUKFastClientValidationException() { var ops = new DomainWAFAdvancedRuleOperations <WAFAdvancedRule>(null); await Assert.ThrowsExceptionAsync <UKFastClientValidationException>(() => ops.CreateDomainWAFAdvancedRuleAsync("", new CreateWAFAdvancedRuleRequest())); }
public async Task CreateDomainWAFAdvancedRuleAsync_ExpectedResult() { var req = new CreateWAFAdvancedRuleRequest() { Section = "REQUEST_URI", Phrase = "test", IP = "1.2.3.4" }; _client.PostAsync <WAFAdvancedRule>($"/ddosx/v1/domains/test-domain.co.uk/waf/advanced-rules", req).Returns(new WAFAdvancedRule() { ID = "00000000-0000-0000-0000-000000000000" }); var ops = new DomainWAFAdvancedRuleOperations <WAFAdvancedRule>(_client); var ruleID = await ops.CreateDomainWAFAdvancedRuleAsync("test-domain.co.uk", req); Assert.AreEqual("00000000-0000-0000-0000-000000000000", ruleID); }