public void AmericanPostalCodeGenerator()
 {
     IGenerator<string> postalgen = new AmericanPostalCodeGenerator(1);
     var zipcode = (string) postalgen.Generate();
     Assert.IsNotNull(zipcode);
     Assert.IsTrue(IsAmericanPostalCodeValid(zipcode));
 }
Exemple #2
0
        public void AmericanPostalCodeGeneratorNoPlusFourTest()
        {
            IGenerator <string> postalgen = new AmericanPostalCodeGenerator(0);
            var zipcode = (string)postalgen.Generate();

            Assert.IsNotNull(zipcode);
            Assert.IsTrue(IsAmericanPostalCodeValid(zipcode));
        }
Exemple #3
0
        public void AmericanPostalCodeGeneratorNormalWithStringOverride()
        {
            IAmericanPostalCodeGenerator americanpostalcodegenerator = new AmericanPostalCodeGenerator();
            string postalcode = americanpostalcodegenerator.Generate(random, "12345");

            Assert.IsNotNull(postalcode);
            Assert.IsTrue(IsAmericanPostalCodeValid(postalcode));
        }
Exemple #4
0
        public void AmericanPostalCodeGeneratorNormal()
        {
            IAmericanPostalCodeGenerator americanpostalcodegenerator = new AmericanPostalCodeGenerator();
            string zip = americanpostalcodegenerator.Generate(random, false);

            Assert.IsNotNull(zip);
            Assert.DoesNotContain(zip, "-");
            Assert.IsTrue(IsAmericanPostalCodeValid(zip));
        }
Exemple #5
0
        public void AmericanPostalCodeGeneratorPlusFourWithAttributeMap()
        {
            IAmericanPostalCodeGenerator americanpostalcodegenerator = new AmericanPostalCodeGenerator();
            AttributeMap attmap = new AttributeMap {
                DefaultBoolValue = true
            };
            string postalcode = americanpostalcodegenerator.Generate(random, attmap);

            Assert.IsNotNull(postalcode);
            Assert.Contains(postalcode, "-");
            Assert.IsTrue(IsAmericanPostalCodeValid(postalcode));
        }
Exemple #6
0
        public void AmericanPostalCodeGeneratorUsePlusFour()
        {
            IAmericanPostalCodeGenerator americanpostalcodegenerator = new AmericanPostalCodeGenerator();
            string zip = americanpostalcodegenerator.Generate(random, true);

            Assert.IsNotNull(zip);

            Assert.Contains(zip, "-");
            string[] tester = zip.Split("-".ToCharArray());
            Assert.IsTrue(tester[1].Length == 4);
            Assert.IsTrue(IsAmericanPostalCodeValid(zip));
        }
Exemple #7
0
        public void AmericanPostalCodeGeneratorNormalWithAttributeMap()
        {
            IAmericanPostalCodeGenerator americanpostalcodegenerator = new AmericanPostalCodeGenerator();
            AttributeMap attmap = new AttributeMap {
                GeneratorDefaultValue = "12345", DefaultBoolValue = false
            };
            string postalcode = americanpostalcodegenerator.Generate(random, attmap);

            Assert.IsNotNull(postalcode);
            Assert.AreEqual("12345", postalcode);
            Assert.DoesNotContain(postalcode, "-");
            Assert.IsTrue(IsAmericanPostalCodeValid(postalcode));
        }
        public void AmericanPostalCodeGeneratorUsePlusFour()
        {
            IAmericanPostalCodeGenerator americanpostalcodegenerator = new AmericanPostalCodeGenerator();
            string zip = americanpostalcodegenerator.Generate(random, true);
            Assert.IsNotNull(zip);

            Assert.Contains(zip, "-");
            string[] tester = zip.Split("-".ToCharArray());
            Assert.IsTrue(tester[1].Length == 4);
            Assert.IsTrue(IsAmericanPostalCodeValid(zip));
        }
 public void AmericanPostalCodeGeneratorPlusFourWithAttributeMap()
 {
     IAmericanPostalCodeGenerator americanpostalcodegenerator = new AmericanPostalCodeGenerator();
     AttributeMap attmap = new AttributeMap { DefaultBoolValue = true };
     string postalcode = americanpostalcodegenerator.Generate(random, attmap);
     Assert.IsNotNull(postalcode);
     Assert.Contains(postalcode, "-");
     Assert.IsTrue(IsAmericanPostalCodeValid(postalcode));
 }
 public void AmericanPostalCodeGeneratorNormalWithStringOverride()
 {
     IAmericanPostalCodeGenerator americanpostalcodegenerator = new AmericanPostalCodeGenerator();
     string postalcode = americanpostalcodegenerator.Generate(random, "12345");
     Assert.IsNotNull(postalcode);
     Assert.IsTrue(IsAmericanPostalCodeValid(postalcode));
 }
 public void AmericanPostalCodeGeneratorNormalWithAttributeMap()
 {
     IAmericanPostalCodeGenerator americanpostalcodegenerator=new AmericanPostalCodeGenerator();
     AttributeMap attmap = new AttributeMap { GeneratorDefaultValue = "12345", DefaultBoolValue=false };
     string postalcode = americanpostalcodegenerator.Generate(random, attmap);
     Assert.IsNotNull(postalcode);
     Assert.AreEqual("12345", postalcode);
     Assert.DoesNotContain(postalcode, "-");
     Assert.IsTrue(IsAmericanPostalCodeValid(postalcode));
 }
 public void AmericanPostalCodeGeneratorNormal()
 {
     IAmericanPostalCodeGenerator americanpostalcodegenerator = new AmericanPostalCodeGenerator();
     string zip = americanpostalcodegenerator.Generate(random, false);
     Assert.IsNotNull(zip);
     Assert.DoesNotContain(zip, "-");
     Assert.IsTrue(IsAmericanPostalCodeValid(zip));
 }