Пример #1
0
        public async Task GetZoneNoteAsync_ValidParameters_ExpectedResult()
        {
            IANSSafeDNSClient client = Substitute.For <IANSSafeDNSClient>();

            client.GetAsync <Note>("/safedns/v1/zones/example.com/notes/123").Returns(new Note()
            {
                ID = 123
            });

            var ops  = new ZoneNoteOperations <Note>(client);
            var note = await ops.GetNoteAsync("example.com", 123);

            Assert.AreEqual(123, note.ID);
        }
Пример #2
0
 public async Task GetZoneNoteAsync_InvalidNoteID_ThrowsANSClientValidationException()
 {
     var ops = new ZoneNoteOperations <Note>(null);
     await Assert.ThrowsExceptionAsync <ANSClientValidationException>(() => ops.GetNoteAsync("example.com", 0));
 }
Пример #3
0
 public async Task GetZoneNoteAsync_InvalidZoneName_ThrowsANSClientValidationException()
 {
     var ops = new ZoneNoteOperations <Note>(null);
     await Assert.ThrowsExceptionAsync <ANSClientValidationException>(() => ops.GetNoteAsync("", 123));
 }