コード例 #1
0
        ///<summary>
        ///  Returns a Typed OrdersQry Entity with mock values.
        ///</summary>
        public static OrdersQry CreateMockInstance()
        {
            OrdersQry mock = new OrdersQry();

            mock.OrderId = TestUtility.Instance.RandomNumber();
            mock.CustomerId = TestUtility.Instance.RandomString(5, false);;
            mock.EmployeeId = TestUtility.Instance.RandomNumber();
            mock.OrderDate = TestUtility.Instance.RandomDateTime();
            mock.RequiredDate = TestUtility.Instance.RandomDateTime();
            mock.ShippedDate = TestUtility.Instance.RandomDateTime();
            mock.ShipVia = TestUtility.Instance.RandomNumber();
            mock.Freight = TestUtility.Instance.RandomShort();
            mock.ShipName = TestUtility.Instance.RandomString(19, false);;
            mock.ShipAddress = TestUtility.Instance.RandomString(29, false);;
            mock.ShipCity = TestUtility.Instance.RandomString(6, false);;
            mock.ShipRegion = TestUtility.Instance.RandomString(6, false);;
            mock.ShipPostalCode = TestUtility.Instance.RandomString(10, false);;
            mock.ShipCountry = TestUtility.Instance.RandomString(6, false);;
            mock.CompanyName = TestUtility.Instance.RandomString(19, false);;
            mock.Address = TestUtility.Instance.RandomString(29, false);;
            mock.City = TestUtility.Instance.RandomString(6, false);;
            mock.Region = TestUtility.Instance.RandomString(6, false);;
            mock.PostalCode = TestUtility.Instance.RandomString(10, false);;
            mock.Country = TestUtility.Instance.RandomString(6, false);;
               return (OrdersQry)mock;
        }
コード例 #2
0
 ///<summary>
 ///  Returns a Typed OrdersQryBase Entity 
 ///</summary>
 public virtual OrdersQryBase Copy()
 {
     //shallow copy entity
     OrdersQry copy = new OrdersQry();
         copy.OrderId = this.OrderId;
         copy.CustomerId = this.CustomerId;
         copy.EmployeeId = this.EmployeeId;
         copy.OrderDate = this.OrderDate;
         copy.RequiredDate = this.RequiredDate;
         copy.ShippedDate = this.ShippedDate;
         copy.ShipVia = this.ShipVia;
         copy.Freight = this.Freight;
         copy.ShipName = this.ShipName;
         copy.ShipAddress = this.ShipAddress;
         copy.ShipCity = this.ShipCity;
         copy.ShipRegion = this.ShipRegion;
         copy.ShipPostalCode = this.ShipPostalCode;
         copy.ShipCountry = this.ShipCountry;
         copy.CompanyName = this.CompanyName;
         copy.Address = this.Address;
         copy.City = this.City;
         copy.Region = this.Region;
         copy.PostalCode = this.PostalCode;
         copy.Country = this.Country;
     copy.AcceptChanges();
     return (OrdersQry)copy;
 }
コード例 #3
0
 /// <summary>
 /// Gets the property value by name.
 /// </summary>
 /// <param name="entity">The entity.</param>
 /// <param name="propertyName">Name of the property.</param>
 /// <returns></returns>
 public static object GetPropertyValueByName(OrdersQry entity, string propertyName)
 {
     switch (propertyName)
     {
         case "OrderId":
             return entity.OrderId;
         case "CustomerId":
             return entity.CustomerId;
         case "EmployeeId":
             return entity.EmployeeId;
         case "OrderDate":
             return entity.OrderDate;
         case "RequiredDate":
             return entity.RequiredDate;
         case "ShippedDate":
             return entity.ShippedDate;
         case "ShipVia":
             return entity.ShipVia;
         case "Freight":
             return entity.Freight;
         case "ShipName":
             return entity.ShipName;
         case "ShipAddress":
             return entity.ShipAddress;
         case "ShipCity":
             return entity.ShipCity;
         case "ShipRegion":
             return entity.ShipRegion;
         case "ShipPostalCode":
             return entity.ShipPostalCode;
         case "ShipCountry":
             return entity.ShipCountry;
         case "CompanyName":
             return entity.CompanyName;
         case "Address":
             return entity.Address;
         case "City":
             return entity.City;
         case "Region":
             return entity.Region;
         case "PostalCode":
             return entity.PostalCode;
         case "Country":
             return entity.Country;
     }
     return null;
 }
コード例 #4
0
 ///<summary>
 /// A simple factory method to create a new <see cref="OrdersQry"/> instance.
 ///</summary>
 ///<param name="_orderId"></param>
 ///<param name="_customerId"></param>
 ///<param name="_employeeId"></param>
 ///<param name="_orderDate"></param>
 ///<param name="_requiredDate"></param>
 ///<param name="_shippedDate"></param>
 ///<param name="_shipVia"></param>
 ///<param name="_freight"></param>
 ///<param name="_shipName"></param>
 ///<param name="_shipAddress"></param>
 ///<param name="_shipCity"></param>
 ///<param name="_shipRegion"></param>
 ///<param name="_shipPostalCode"></param>
 ///<param name="_shipCountry"></param>
 ///<param name="_companyName"></param>
 ///<param name="_address"></param>
 ///<param name="_city"></param>
 ///<param name="_region"></param>
 ///<param name="_postalCode"></param>
 ///<param name="_country"></param>
 public static OrdersQry CreateOrdersQry(System.Int32 _orderId, System.String _customerId, System.Int32? _employeeId, System.DateTime? _orderDate, System.DateTime? _requiredDate, System.DateTime? _shippedDate, System.Int32? _shipVia, System.Decimal? _freight, System.String _shipName, System.String _shipAddress, System.String _shipCity, System.String _shipRegion, System.String _shipPostalCode, System.String _shipCountry, System.String _companyName, System.String _address, System.String _city, System.String _region, System.String _postalCode, System.String _country)
 {
     OrdersQry newOrdersQry = new OrdersQry();
     newOrdersQry.OrderId = _orderId;
     newOrdersQry.CustomerId = _customerId;
     newOrdersQry.EmployeeId = _employeeId;
     newOrdersQry.OrderDate = _orderDate;
     newOrdersQry.RequiredDate = _requiredDate;
     newOrdersQry.ShippedDate = _shippedDate;
     newOrdersQry.ShipVia = _shipVia;
     newOrdersQry.Freight = _freight;
     newOrdersQry.ShipName = _shipName;
     newOrdersQry.ShipAddress = _shipAddress;
     newOrdersQry.ShipCity = _shipCity;
     newOrdersQry.ShipRegion = _shipRegion;
     newOrdersQry.ShipPostalCode = _shipPostalCode;
     newOrdersQry.ShipCountry = _shipCountry;
     newOrdersQry.CompanyName = _companyName;
     newOrdersQry.Address = _address;
     newOrdersQry.City = _city;
     newOrdersQry.Region = _region;
     newOrdersQry.PostalCode = _postalCode;
     newOrdersQry.Country = _country;
     return newOrdersQry;
 }
コード例 #5
0
 public object Handle(OrdersQry query)
 {
     throw new NotImplementedException();
 }
コード例 #6
0
        /// <summary>
        /// Deserialize the mock OrdersQry entity from a temporary file.
        /// </summary>
        private void Step_7_DeserializeEntity_Generated()
        {
            string fileName = "temp_OrdersQry.xml";

            XmlSerializer mySerializer = new XmlSerializer(typeof(OrdersQry));
            System.IO.FileStream myFileStream = new System.IO.FileStream(fileName,  System.IO.FileMode.Open);
            mock = (OrdersQry) mySerializer.Deserialize(myFileStream);
            myFileStream.Close();
            System.IO.File.Delete(fileName);

            System.Console.WriteLine("mock correctly deserialized from a temporary file.");
        }