Exemplo n.º 1
0
 public static IQueryable <Supplier> Suppliers(int count = 5)
 {
     return(Any.Sequence(x => Any.Supplier(s =>
     {
         s.Id = x;
         s.Products = Any.Sequence(y => Any.SuppliedProduct(p =>
         {
             p.Id = x * 100 + y;
             p.SupplierId = x;
             p.Supplier = s;
         })).ToList();
     }), count).ToList().AsQueryable());
 }
Exemplo n.º 2
0
        public static Supplier Supplier(Action <Supplier> config = null)
        {
            var retVal = new Supplier
            {
                Id       = Any.Int(),
                Name     = Any.CompanyName(),
                Blob     = Any.Sequence <byte>(x => Any.Byte()).ToArray(),
                Location = GeographyPoint.Create(Any.Double(-90, 90), Any.Double(-180, 180))
            };

            retVal.Products = Any.Sequence(_ => Any.SuppliedProduct(p =>
            {
                p.SupplierId = retVal.Id;
                p.Supplier   = retVal;
            })).ToList();

            if (config != null)
            {
                config(retVal);
            }

            return(retVal);
        }