Ejemplo n.º 1
0
        /// <summary>
        /// Auto populate some static sample data for stock
        /// </summary>
        static BookService()
        {
            var fixture = new Fixture();

            fixture.Customizations.Add(
                new StringGenerator(() =>
                                    Guid.NewGuid().ToString().Substring(0, 10)));

            fixture.Register <Price>(() => SampleDataGenerator.GetRandomPrice());
            fixture.Register <int>(() => SampleDataGenerator.GetRandomYear());

            fixture.AddManyTo(_privateStock, 10);
            _privateStock.ForEach(c =>
            {
                c.MakePrivateListing();
            });

            fixture.AddManyTo(_dealerStock, 10);
            _dealerStock.ForEach(c =>
            {
                c.MakeDealerListing();
            });
        }