Example #1
0
        public void MethodIsLeftAloneWhenMatchesNothing()
        {
            // currently fills
            var person = Angie.FastMake <Person>();

            Assert.IsTrue(string.IsNullOrEmpty(person.GetMiddleName()));
        }
Example #2
0
        public void TwitterResourceTest()
        {
            var    person    = Angie.FastMake <Person>();
            string emailFail = string.Format(Angie.Defaults.STRING_LOADFAIL, Angie.Defaults.FILE_DOMAIN_NAMES);

            Assert.AreNotEqual(string.Empty, person.EmailAddress, emailFail);
        }
Example #3
0
        public void DomainResourceTest()
        {
            var    person      = Angie.FastMake <Person>();
            string twitterFail = string.Format(Angie.Defaults.STRING_LOADFAIL, Angie.Defaults.FILE_FIRST_NAMES);

            Assert.AreNotEqual(string.Empty, person.Twitter, twitterFail);
        }
Example #4
0
        public void WordsResourcesLoad()
        {
            var    person   = Angie.FastMake <Person>();
            string wordFail = string.Format(Angie.Defaults.STRING_LOADFAIL, Angie.Defaults.FILE_WORDS);

            Assert.AreNotEqual(string.Empty, person.Title, wordFail);
        }
Example #5
0
        public void TitleResourcesLoad()
        {
            var    post      = Angie.FastMake <BlogPost>();
            string titleFail = string.Format(Angie.Defaults.STRING_LOADFAIL, Angie.Defaults.FILE_TITLES);

            Assert.AreNotEqual(string.Empty, post.Title, titleFail);
        }
Example #6
0
        public void LastNamesResourcesLoad()
        {
            var    person   = Angie.FastMake <Person>();
            string nameFail = string.Format(Angie.Defaults.STRING_LOADFAIL, Angie.Defaults.FILE_LAST_NAMES);

            Assert.AreNotEqual(string.Empty, person.LastName, nameFail);
        }
Example #7
0
        public void EmailAddressInNewClassIsValid()
        {
            Person person = Angie.FastMake <Person>();
            Regex  regex  = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
            Match  match  = regex.Match(person.EmailAddress);

            Assert.IsTrue(match.Success, "Invalid Email Address: {0}", person.EmailAddress);
        }
Example #8
0
        public void ShortMinNotExceededOnGeneratedValue()
        {
            short minNumberOfKids = 5;

            Angie.Default()
            .MinShort(minNumberOfKids);

            for (int i = 0; i < 500; i++)
            {
                var instance = Angie
                               .FastMake <ClassWithShortProperty>();

                if (!(instance.ShortProperty >= minNumberOfKids))
                {
                    Assert.Fail("Short min was exceeded: {0} ", instance.ShortProperty);
                }
            }
        }
Example #9
0
        public void ShortMaxNotExceededOnGeneratedValue()
        {
            short maxShort = 4;

            Angie.Default()
            .MaxShort(maxShort);

            for (int i = 0; i < 500; i++)
            {
                var instance = Angie
                               .FastMake <ClassWithShortProperty>();

                if (!(instance.ShortProperty <= maxShort))
                {
                    Assert.Fail("Short max was exceeded: {0} ", instance.ShortProperty);
                }
            }
        }
Example #10
0
        public void IntMaxNotExceededOnGeneratedValue()
        {
            var maxNumberOfKids = 5;

            Angie.Default()
            .MaxInt(maxNumberOfKids);

            for (int i = 0; i < 500; i++)
            {
                var person = Angie
                             .FastMake <Person>();

                if (!(person.NumberOfKids <= maxNumberOfKids))
                {
                    Assert.Fail("Int max was exceeded: {0} ", person.NumberOfKids);
                }
            }
        }
Example #11
0
        public void StringInNewClassIsPopulated()
        {
            var person = Angie.FastMake <Person>();

            Assert.IsTrue(!string.IsNullOrEmpty(person.FirstName));
        }
Example #12
0
        public void UsaStateIsFilled()
        {
            var location = Angie.FastMake <AmericanLocation>();

            Assert.IsFalse(string.IsNullOrEmpty(location.State));
        }
Example #13
0
        public void IntInNewClassIsPopulated()
        {
            var person = Angie.FastMake <Person>();

            Assert.IsTrue(person.NumberOfKids != default(int));
        }
Example #14
0
        public void CanadianProvinceIsFilled()
        {
            var location = Angie.FastMake <CanadianLocation>();

            Assert.IsFalse(string.IsNullOrEmpty(location.Province));
        }
Example #15
0
        public void PhoneNumberInNewClassIsPopulated()
        {
            var person = Angie.FastMake <Person>();

            Assert.IsTrue(!string.IsNullOrEmpty(person.PhoneNumber));
        }
Example #16
0
        public void DateTimesAreInitialized()
        {
            var post = Angie.FastMake <BlogPost>();

            Assert.IsTrue(post.CreateDate != default(DateTime));
        }
        public void TestThatAdditionalFiltersAreFoundAndUsed()
        {
            TestClass testClass = Angie.FastMake <TestClass>();

            Assert.AreEqual(PluginPropertyFiller.Value, testClass.TestProperty);
        }
Example #18
0
        public void AgeIsAlwaysPositive()
        {
            var person = Angie.FastMake <Person>();

            Assert.IsTrue(person.Age >= 0);
        }