Exemple #1
0
        static void Main(string[] args)
        {
            Console.InputEncoding  = Encoding.Unicode;
            Console.OutputEncoding = Encoding.Unicode;
            ProductG p = new ProductG();
            ProductT t = new ProductT();

            //for(int i = 0;i<5;i++)
            //{
            //    t.AddProduct();
            //}

            //p.ShowPRoduct();
            //p.WriteFile();
            //p.ReadFile();
            for (int i = 0; i < 5; i++)
            {
                p.AddProduct();
            }
            t.AddProduct();
            t.ShowPRoduct();
            t.WriteDDR();


            Console.ReadLine();

            AppKernel = new StandardKernel(new UseG());


            var useG = AppKernel.Get <ProductG>();

            useG.AddProduct();

            Console.ReadLine();
        }
Exemple #2
0
        public void AddProduct()
        {
            var fruit = new[] { "apple", "banana", "orange", "strawberry", "kiwi", "potato", "grape", "pineapple" };

            var testProductG = new Faker <ProductG>("uk")
                               .CustomInstantiator(f => new ProductG(userIds++))
                               .RuleFor(u => u.Name, f => f.PickRandom(fruit))
                               .RuleFor(u => u.Country, f => f.Address.Country());

            ProductG ProductItem = testProductG.Generate();

            p.Add(ProductItem);
        }