///<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;
        }
Пример #2
0
        ///<summary>
        ///  Update the Typed BillOfMaterials Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance_Generated(TransactionManager tm, BillOfMaterials mock)
        {
            mock.StartDate      = TestUtility.Instance.RandomDateTime();
            mock.EndDate        = TestUtility.Instance.RandomDateTime();
            mock.BomLevel       = TestUtility.Instance.RandomShort();
            mock.PerAssemblyQty = (decimal)TestUtility.Instance.RandomShort();
            mock.ModifiedDate   = TestUtility.Instance.RandomDateTime();

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

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

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

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

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

            DataRepository.UnitMeasureProvider.Insert(tm, mockUnitMeasureByUnitMeasureCode);
            mock.UnitMeasureCode = mockUnitMeasureByUnitMeasureCode.UnitMeasureCode;
        }
Пример #3
0
        ///<summary>
        ///  Returns a Typed BillOfMaterials Entity with mock values.
        ///</summary>
        static public BillOfMaterials CreateMockInstance_Generated(TransactionManager tm)
        {
            BillOfMaterials mock = new BillOfMaterials();

            mock.StartDate      = TestUtility.Instance.RandomDateTime();
            mock.EndDate        = TestUtility.Instance.RandomDateTime();
            mock.BomLevel       = TestUtility.Instance.RandomShort();
            mock.PerAssemblyQty = (decimal)TestUtility.Instance.RandomShort();
            mock.ModifiedDate   = TestUtility.Instance.RandomDateTime();

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

            DataRepository.ProductProvider.Insert(tm, mockProductByComponentId);
            mock.ComponentId = mockProductByComponentId.ProductId;
            //OneToOneRelationship
            Product mockProductByProductAssemblyId = ProductTest.CreateMockInstance(tm);

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

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

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

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


            return((BillOfMaterials)mock);
        }
Пример #4
0
        ///<summary>
        ///  Update the Typed UnitMeasure Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance(TransactionManager tm, UnitMeasure mock)
        {
            UnitMeasureTest.UpdateMockInstance_Generated(tm, mock);

            // make any alterations necessary
            // (i.e. for DB check constraints, special test cases, etc.)
            SetSpecialTestData(mock);
        }
Пример #5
0
        ///<summary>
        ///  Returns a Typed UnitMeasure Entity with mock values.
        ///</summary>
        static public UnitMeasure CreateMockInstance(TransactionManager tm)
        {
            // get the default mock instance
            UnitMeasure mock = UnitMeasureTest.CreateMockInstance_Generated(tm);

            // make any alterations necessary
            // (i.e. for DB check constraints, special test cases, etc.)
            SetSpecialTestData(mock);

            // return the modified object
            return(mock);
        }
        ///<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);
        }