Esempio n. 1
0
        /// <summary>
        /// Create and return a randomly-generated BOM data structure.
        /// </summary>
        /// <returns></returns>
        public static MfgBom CreateFakeBOM()
        {
            var bom = new MfgBom()
            {
                Parts = new List <Part>()
            };

            Random random = new Random();

            for (int i = 0; i <= 3; i++)
            {
                var part = new Part()
                {
                    octopart_mpn = Path.GetRandomFileName()
                };
                bom.Parts.Add(part);

                for (int j = 0; j <= 3; j++)
                {
                    var instance = new ComponentInstance()
                    {
                        gme_object_id = random.Next(100000).ToString(),
                        path          = Path.GetRandomFileName()
                    };
                    part.AddInstance(instance);
                }
            }

            return(bom);
        }
        /// <summary>
        /// Create and return a randomly-generated BOM data structure.
        /// </summary>
        /// <returns></returns>
        public static MfgBom CreateFakeBOM()
        {
            var bom = new MfgBom()
            {
                Parts = new List<Part>()
            };

            Random random = new Random();
            for (int i = 0; i <= 3; i++)
            {
                var part = new Part()
                {
                    octopart_mpn = Path.GetRandomFileName()
                };
                bom.Parts.Add(part);

                for (int j = 0; j <= 3; j++)
                {
                    var instance = new ComponentInstance()
                    {
                        gme_object_id = random.Next(100000).ToString(),
                        path = Path.GetRandomFileName()
                    };
                    part.AddInstance(instance);
                }
            }

            return bom;
        }