CreateMockInstance() 정적인 공개 메소드

Returns a Typed Vendor Entity with mock values.
static public CreateMockInstance ( TransactionManager tm ) : Vendor
tm TransactionManager
리턴 Vendor
예제 #1
0
        ///<summary>
        ///  Returns a Typed VendorAddress Entity with mock values.
        ///</summary>
        static public VendorAddress CreateMockInstance_Generated(TransactionManager tm)
        {
            VendorAddress mock = new VendorAddress();

            mock.ModifiedDate = TestUtility.Instance.RandomDateTime();

            //OneToOneRelationship
            Address mockAddressByAddressId = AddressTest.CreateMockInstance(tm);

            DataRepository.AddressProvider.Insert(tm, mockAddressByAddressId);
            mock.AddressId = mockAddressByAddressId.AddressId;
            //OneToOneRelationship
            AddressType mockAddressTypeByAddressTypeId = AddressTypeTest.CreateMockInstance(tm);

            DataRepository.AddressTypeProvider.Insert(tm, mockAddressTypeByAddressTypeId);
            mock.AddressTypeId = mockAddressTypeByAddressTypeId.AddressTypeId;
            //OneToOneRelationship
            Vendor mockVendorByVendorId = VendorTest.CreateMockInstance(tm);

            DataRepository.VendorProvider.Insert(tm, mockVendorByVendorId);
            mock.VendorId = mockVendorByVendorId.VendorId;

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

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


            return((VendorAddress)mock);
        }
        ///<summary>
        ///  Update the Typed ProductVendor Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance_Generated(TransactionManager tm, ProductVendor mock)
        {
            mock.AverageLeadTime = TestUtility.Instance.RandomNumber();
            mock.StandardPrice   = TestUtility.Instance.RandomShort();
            mock.LastReceiptCost = TestUtility.Instance.RandomShort();
            mock.LastReceiptDate = TestUtility.Instance.RandomDateTime();
            mock.MinOrderQty     = TestUtility.Instance.RandomNumber();
            mock.MaxOrderQty     = TestUtility.Instance.RandomNumber();
            mock.OnOrderQty      = TestUtility.Instance.RandomNumber();
            mock.ModifiedDate    = TestUtility.Instance.RandomDateTime();

            //OneToOneRelationship
            Product mockProductByProductId = ProductTest.CreateMockInstance(tm);

            DataRepository.ProductProvider.Insert(tm, mockProductByProductId);
            mock.ProductId = mockProductByProductId.ProductId;

            //OneToOneRelationship
            UnitMeasure mockUnitMeasureByUnitMeasureCode = UnitMeasureTest.CreateMockInstance(tm);

            DataRepository.UnitMeasureProvider.Insert(tm, mockUnitMeasureByUnitMeasureCode);
            mock.UnitMeasureCode = mockUnitMeasureByUnitMeasureCode.UnitMeasureCode;

            //OneToOneRelationship
            Vendor mockVendorByVendorId = VendorTest.CreateMockInstance(tm);

            DataRepository.VendorProvider.Insert(tm, mockVendorByVendorId);
            mock.VendorId = mockVendorByVendorId.VendorId;
        }
예제 #3
0
        ///<summary>
        ///  Update the Typed VendorAddress Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance_Generated(TransactionManager tm, VendorAddress mock)
        {
            mock.ModifiedDate = TestUtility.Instance.RandomDateTime();

            //OneToOneRelationship
            Address mockAddressByAddressId = AddressTest.CreateMockInstance(tm);

            DataRepository.AddressProvider.Insert(tm, mockAddressByAddressId);
            mock.AddressId = mockAddressByAddressId.AddressId;

            //OneToOneRelationship
            AddressType mockAddressTypeByAddressTypeId = AddressTypeTest.CreateMockInstance(tm);

            DataRepository.AddressTypeProvider.Insert(tm, mockAddressTypeByAddressTypeId);
            mock.AddressTypeId = mockAddressTypeByAddressTypeId.AddressTypeId;

            //OneToOneRelationship
            Vendor mockVendorByVendorId = VendorTest.CreateMockInstance(tm);

            DataRepository.VendorProvider.Insert(tm, mockVendorByVendorId);
            mock.VendorId = mockVendorByVendorId.VendorId;
        }
예제 #4
0
        ///<summary>
        ///  Update the Typed VendorContact Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance_Generated(TransactionManager tm, VendorContact mock)
        {
            mock.ModifiedDate = TestUtility.Instance.RandomDateTime();

            //OneToOneRelationship
            Contact mockContactByContactId = ContactTest.CreateMockInstance(tm);

            DataRepository.ContactProvider.Insert(tm, mockContactByContactId);
            mock.ContactId = mockContactByContactId.ContactId;

            //OneToOneRelationship
            ContactType mockContactTypeByContactTypeId = ContactTypeTest.CreateMockInstance(tm);

            DataRepository.ContactTypeProvider.Insert(tm, mockContactTypeByContactTypeId);
            mock.ContactTypeId = mockContactTypeByContactTypeId.ContactTypeId;

            //OneToOneRelationship
            Vendor mockVendorByVendorId = VendorTest.CreateMockInstance(tm);

            DataRepository.VendorProvider.Insert(tm, mockVendorByVendorId);
            mock.VendorId = mockVendorByVendorId.VendorId;
        }
        ///<summary>
        ///  Returns a Typed ProductVendor Entity with mock values.
        ///</summary>
        static public ProductVendor CreateMockInstance_Generated(TransactionManager tm)
        {
            ProductVendor mock = new ProductVendor();

            mock.AverageLeadTime = TestUtility.Instance.RandomNumber();
            mock.StandardPrice   = TestUtility.Instance.RandomShort();
            mock.LastReceiptCost = TestUtility.Instance.RandomShort();
            mock.LastReceiptDate = TestUtility.Instance.RandomDateTime();
            mock.MinOrderQty     = TestUtility.Instance.RandomNumber();
            mock.MaxOrderQty     = TestUtility.Instance.RandomNumber();
            mock.OnOrderQty      = TestUtility.Instance.RandomNumber();
            mock.ModifiedDate    = TestUtility.Instance.RandomDateTime();

            //OneToOneRelationship
            Product mockProductByProductId = ProductTest.CreateMockInstance(tm);

            DataRepository.ProductProvider.Insert(tm, mockProductByProductId);
            mock.ProductId = mockProductByProductId.ProductId;
            //OneToOneRelationship
            UnitMeasure mockUnitMeasureByUnitMeasureCode = UnitMeasureTest.CreateMockInstance(tm);

            DataRepository.UnitMeasureProvider.Insert(tm, mockUnitMeasureByUnitMeasureCode);
            mock.UnitMeasureCode = mockUnitMeasureByUnitMeasureCode.UnitMeasureCode;
            //OneToOneRelationship
            Vendor mockVendorByVendorId = VendorTest.CreateMockInstance(tm);

            DataRepository.VendorProvider.Insert(tm, mockVendorByVendorId);
            mock.VendorId = mockVendorByVendorId.VendorId;

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

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


            return((ProductVendor)mock);
        }