public async Task ResolveNameAsync_MixedAddressAndRecordTypes_OnlyIncludesVaildRecords(string address, FlatRecordType recordType) { // Arrange Mock <ILocalDNS> mockLocalDNS = BuildMockLocalDNS(IPv4Address, IPv6Address); SystemDNSResolver resolver = new SystemDNSResolver(mockLocalDNS.Object); // Act List <FlatTargetRecord> result = await resolver.ResolveNameAsync(It.IsAny <string>(), recordType); // Assert Assert.Equal(address, result.Single().Address); }
public async Task ResolveNameAsync_SingleAddressCorrectRecordType_HasAdress(string address, FlatRecordType recordType) { // Arrange Mock <ILocalDNS> mockLocalDNS = BuildMockLocalDNS(address); SystemDNSResolver resolver = new SystemDNSResolver(mockLocalDNS.Object); // Act List <FlatTargetRecord> result = await resolver.ResolveNameAsync(It.IsAny <string>(), recordType); // Assert Assert.Equal(address, result.Single().Address); }
public async Task ResolveNameAsync_SingleAddressIncorrectRecordType_DoesNotIncludeIncorrectRecords(string address, FlatRecordType recordType) { // Arrange Mock <ILocalDNS> mockLocalDNS = BuildMockLocalDNS(address); SystemDNSResolver resolver = new SystemDNSResolver(mockLocalDNS.Object); // Act List <FlatTargetRecord> result = await resolver.ResolveNameAsync(It.IsAny <string>(), recordType); // Assert Assert.Empty(result); }
public async Task ResolveNameAsync_SingleAddress_TTLIsNull() { // Arrange Mock <ILocalDNS> mockLocalDNS = BuildMockLocalDNS(IPv4Address); SystemDNSResolver resolver = new SystemDNSResolver(mockLocalDNS.Object); // Act List <FlatTargetRecord> result = await resolver.ResolveNameAsync(It.IsAny <string>(), FlatRecordType.A); // Assert Assert.False(result.Single().TTL.HasValue); }