CreateMockInstance() статический публичный Метод

Returns a Typed SpecialOfferProduct Entity with mock values.
static public CreateMockInstance ( TransactionManager tm ) : SpecialOfferProduct
tm TransactionManager
Результат SpecialOfferProduct
        ///<summary>
        ///  Returns a Typed SalesOrderDetail Entity with mock values.
        ///</summary>
        static public SalesOrderDetail CreateMockInstance_Generated(TransactionManager tm)
        {
            SalesOrderDetail mock = new SalesOrderDetail();

            mock.CarrierTrackingNumber = TestUtility.Instance.RandomString(11, false);;
            mock.OrderQty          = TestUtility.Instance.RandomShort();
            mock.UnitPrice         = TestUtility.Instance.RandomShort();
            mock.UnitPriceDiscount = TestUtility.Instance.RandomShort();
            mock.ModifiedDate      = TestUtility.Instance.RandomDateTime();

            //OneToOneRelationship
            SalesOrderHeader mockSalesOrderHeaderBySalesOrderId = SalesOrderHeaderTest.CreateMockInstance(tm);

            DataRepository.SalesOrderHeaderProvider.Insert(tm, mockSalesOrderHeaderBySalesOrderId);
            mock.SalesOrderId = mockSalesOrderHeaderBySalesOrderId.SalesOrderId;
            //OneToOneRelationship
            SpecialOfferProduct mockSpecialOfferProductBySpecialOfferIdProductId = SpecialOfferProductTest.CreateMockInstance(tm);

            DataRepository.SpecialOfferProductProvider.Insert(tm, mockSpecialOfferProductBySpecialOfferIdProductId);
            mock.SpecialOfferId = mockSpecialOfferProductBySpecialOfferIdProductId.SpecialOfferId;
            mock.ProductId      = mockSpecialOfferProductBySpecialOfferIdProductId.ProductId;

            // create a temporary collection and add the item to it
            TList <SalesOrderDetail> tempMockCollection = new TList <SalesOrderDetail>();

            tempMockCollection.Add(mock);
            tempMockCollection.Remove(mock);


            return((SalesOrderDetail)mock);
        }
        ///<summary>
        ///  Update the Typed SalesOrderDetail Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance_Generated(TransactionManager tm, SalesOrderDetail mock)
        {
            mock.CarrierTrackingNumber = TestUtility.Instance.RandomString(11, false);;
            mock.OrderQty          = TestUtility.Instance.RandomShort();
            mock.UnitPrice         = TestUtility.Instance.RandomShort();
            mock.UnitPriceDiscount = TestUtility.Instance.RandomShort();
            mock.ModifiedDate      = TestUtility.Instance.RandomDateTime();

            //OneToOneRelationship
            SalesOrderHeader mockSalesOrderHeaderBySalesOrderId = SalesOrderHeaderTest.CreateMockInstance(tm);

            DataRepository.SalesOrderHeaderProvider.Insert(tm, mockSalesOrderHeaderBySalesOrderId);
            mock.SalesOrderId = mockSalesOrderHeaderBySalesOrderId.SalesOrderId;

            //OneToOneRelationship
            SpecialOfferProduct mockSpecialOfferProductBySpecialOfferIdProductId = SpecialOfferProductTest.CreateMockInstance(tm);

            DataRepository.SpecialOfferProductProvider.Insert(tm, mockSpecialOfferProductBySpecialOfferIdProductId);
            mock.SpecialOfferId = mockSpecialOfferProductBySpecialOfferIdProductId.SpecialOfferId;
            mock.ProductId      = mockSpecialOfferProductBySpecialOfferIdProductId.ProductId;
        }