コード例 #1
0
        public async Task UpdateZoneAsync_ValidParameters_ExpectedClientCall()
        {
            UpdateZoneRequest req = new UpdateZoneRequest()
            {
                Description = "test description 1"
            };

            IANSSafeDNSClient client = Substitute.For <IANSSafeDNSClient>();

            var ops = new ZoneOperations <Zone>(client);
            await ops.UpdateZoneAsync("example.com", req);

            await client.Received().PatchAsync("/safedns/v1/zones/example.com", req);
        }
コード例 #2
0
 public async Task UpdateZoneAsync_InvalidZoneName_ThrowsANSClientValidationException()
 {
     var ops = new ZoneOperations <Zone>(null);
     await Assert.ThrowsExceptionAsync <ANSClientValidationException>(() => ops.UpdateZoneAsync("", null));
 }