Ejemplo n.º 1
0
        public void FastListGeneratesCorrectNumberOfEntries()
        {
            var personCount = 17;
            var people      = Angie.FastList <Person>(personCount);

            Assert.AreEqual(people.Count(), personCount);
        }
Ejemplo n.º 2
0
        public void FastListDefaultGenerates25Entries()
        {
            var people = Angie.FastList <Person>();

            Assert.AreEqual(Angie.Defaults.LIST_COUNT, people.Count(),
                            string.Format("Expected {0} but collection contained {1}",
                                          Angie.Defaults.LIST_COUNT, people.Count())
                            );
        }
Ejemplo n.º 3
0
        public void MakeListGeneratesCorrectNumberOfEntriesWithStaticOverload()
        {
            Angie.Reset();
            var personCount = 13;

            var people = Angie
                         .FastList <Person>(personCount);

            Assert.AreEqual(people.Count(), personCount);
        }
Ejemplo n.º 4
0
        public void MakeListGeneratesCorrectNumberOfEntriesWithDefaults()
        {
            Angie.Reset();
            var personCount = 13;

            Angie.Default()
            .ListCount(personCount);

            var people = Angie
                         .FastList <Person>();

            Assert.AreEqual(people.Count(), personCount);
        }
Ejemplo n.º 5
0
        public void FillPropertyWithRandomValuesFromList()
        {
            IList <Person> peeps = Angie.FastList <Person>(10);

            Angie.Default().ListCount(25);

            IList <Dog> dogs = Angie.Configure <Dog>().Fill(d => d.Owner).WithRandom(peeps).MakeList();

            foreach (Dog dog in dogs)
            {
                Assert.IsNotNull(dog.Owner);
                CollectionAssert.Contains(peeps, dog.Owner);
            }
        }
Ejemplo n.º 6
0
        private static void ANewTrendInMusic()
        {
            var artists = Angie.FastList <Artist>(50);

            var genres = Angie.FastList <Genre>(20);

            var album = Angie
                        .Configure <Album>()
                        .Fill(a => a.Price).WithinRange(7, 10)
                        .Fill(a => a.Artist).WithRandom(artists)
                        .Fill(a => a.Genre).WithRandom(genres)
                        .Make <Album>();

            Console.WriteLine(album.ToString());
        }