public void TestThat_LookupIPAddress_ReturnsTheIPAddressResolvedByTheDnsLookup()
        {
            var dnsLookup = new DnsLookupBuilder().WithIPAddressResolvingTo("1.2.3.4", "some website").Build();
            var controller = new VotingControllerBuilder().WithDnsLookup(dnsLookup).Build();

            var result = controller.LookupIPAddress("1.2.3.4");

            Assert.That(result.Content, Is.EqualTo("some website"));
        }
 public void TestThat_LookupIPAddress_ThrowsAnException_WhenTheSuppliedIPAddressIsInavlid(string ipAddress)
 {
     var controller = new VotingControllerBuilder().Build();
     Assert.Throws<ArgumentException>(() => controller.LookupIPAddress(ipAddress));
 }
        public void TestThat_LookupIPAddress_ResolvesTheIPAddress_UsingTheDnsLookup()
        {
            var dnsLookup = new DnsLookupBuilder().Build();
            var controller = new VotingControllerBuilder().WithDnsLookup(dnsLookup).Build();

            controller.LookupIPAddress("1.2.3.4");

            dnsLookup.Received().Resolve("1.2.3.4");
        }