public void SutIsSpecimenBuilder()
        {
            // Fixture setup

            // Exercise system
            var sut = new DomainNameGenerator();
            // Verify outcome
            Assert.IsAssignableFrom<ISpecimenBuilder>(sut);
            // Teardown
        }
 public void CreateWithNullRequestReturnsCorrectResult()
 {
     // Fixture setup
     var sut = new DomainNameGenerator();
     // Exercise system
     var result = sut.Create(null, null);
     // Verify outcome
     Assert.Equal(new NoSpecimen(), result);
     // Teardown
 }
 public void CreateReturnsOneOfTheFictiousDomains()
 {
     // Fixture setup
     var sut = new DomainNameGenerator();
     // Exercise system
     var result = sut.Create(typeof(DomainName), null);
     // Verify outcome
     var actualDomainName = Assert.IsAssignableFrom<DomainName>(result);
     Assert.True(Regex.IsMatch(actualDomainName.Domain, @"example\.(com|org|net)"));
     // Teardown
 }
        public void CreateWithNonDomainNameRequestReturnsCorrectResult()
        {
            // Fixture setup
            var nonDomainNameRequest = typeof(object);
            var sut = new DomainNameGenerator();
            // Exercise system
            var result = sut.Create(nonDomainNameRequest, null);
            // Verify outcome
#pragma warning disable 618
            Assert.Equal(new NoSpecimen(nonDomainNameRequest), result);
#pragma warning restore 618
            // Teardown
        }
 public void CreateManyTimesReturnsAllConfiguredFictiousDomains()
 {
     // Fixture setup
     var sut = new DomainNameGenerator();
     var expectedDomains = new[] {"example.com", "example.net", "example.org"}.Select(x => new DomainName(x)).ToList();
     // Exercise system
     var result = Enumerable.Range(0, 100).Select(x => sut.Create(typeof(DomainName), null)).ToList();
     // Verify outcome
     foreach (var expectedDomain in expectedDomains)
     {
         Assert.Contains(expectedDomain, result);
     }
     // Teardown
 }