Ejemplo n.º 1
0
        public async Task GetZoneAsync_ValidParameters_ExpectedResult()
        {
            IANSSafeDNSClient client = Substitute.For <IANSSafeDNSClient>();

            client.GetAsync <Zone>("/safedns/v1/zones/example.com").Returns(new Zone()
            {
                Name = "example.com"
            });

            var ops  = new ZoneOperations <Zone>(client);
            var zone = await ops.GetZoneAsync("example.com");

            Assert.AreEqual("example.com", zone.Name);
        }
Ejemplo n.º 2
0
 public async Task GetZoneAsync_InvalidZoneName_ThrowsANSClientValidationException()
 {
     var ops = new ZoneOperations <Zone>(null);
     await Assert.ThrowsExceptionAsync <ANSClientValidationException>(() => ops.GetZoneAsync(""));
 }