static public CreateMockInstance ( TransactionManager tm ) : SalesOrderHeader | ||
tm | TransactionManager | |
리턴 | SalesOrderHeader |
///<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> /// Returns a Typed SalesOrderHeaderSalesReason Entity with mock values. ///</summary> static public SalesOrderHeaderSalesReason CreateMockInstance_Generated(TransactionManager tm) { SalesOrderHeaderSalesReason mock = new SalesOrderHeaderSalesReason(); mock.ModifiedDate = TestUtility.Instance.RandomDateTime(); //OneToOneRelationship SalesOrderHeader mockSalesOrderHeaderBySalesOrderId = SalesOrderHeaderTest.CreateMockInstance(tm); DataRepository.SalesOrderHeaderProvider.Insert(tm, mockSalesOrderHeaderBySalesOrderId); mock.SalesOrderId = mockSalesOrderHeaderBySalesOrderId.SalesOrderId; //OneToOneRelationship SalesReason mockSalesReasonBySalesReasonId = SalesReasonTest.CreateMockInstance(tm); DataRepository.SalesReasonProvider.Insert(tm, mockSalesReasonBySalesReasonId); mock.SalesReasonId = mockSalesReasonBySalesReasonId.SalesReasonId; // create a temporary collection and add the item to it TList <SalesOrderHeaderSalesReason> tempMockCollection = new TList <SalesOrderHeaderSalesReason>(); tempMockCollection.Add(mock); tempMockCollection.Remove(mock); return((SalesOrderHeaderSalesReason)mock); }
///<summary> /// Update the Typed SalesOrderHeaderSalesReason Entity with modified mock values. ///</summary> static public void UpdateMockInstance_Generated(TransactionManager tm, SalesOrderHeaderSalesReason mock) { mock.ModifiedDate = TestUtility.Instance.RandomDateTime(); //OneToOneRelationship SalesOrderHeader mockSalesOrderHeaderBySalesOrderId = SalesOrderHeaderTest.CreateMockInstance(tm); DataRepository.SalesOrderHeaderProvider.Insert(tm, mockSalesOrderHeaderBySalesOrderId); mock.SalesOrderId = mockSalesOrderHeaderBySalesOrderId.SalesOrderId; //OneToOneRelationship SalesReason mockSalesReasonBySalesReasonId = SalesReasonTest.CreateMockInstance(tm); DataRepository.SalesReasonProvider.Insert(tm, mockSalesReasonBySalesReasonId); mock.SalesReasonId = mockSalesReasonBySalesReasonId.SalesReasonId; }
///<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; }