///<summary>
        ///  Returns a Typed ProductProductPhoto Entity with mock values.
        ///</summary>
        static public ProductProductPhoto CreateMockInstance_Generated(TransactionManager tm)
        {
            ProductProductPhoto mock = new ProductProductPhoto();

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

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

            DataRepository.ProductProvider.Insert(tm, mockProductByProductId);
            mock.ProductId = mockProductByProductId.ProductId;
            //OneToOneRelationship
            ProductPhoto mockProductPhotoByProductPhotoId = ProductPhotoTest.CreateMockInstance(tm);

            DataRepository.ProductPhotoProvider.Insert(tm, mockProductPhotoByProductPhotoId);
            mock.ProductPhotoId = mockProductPhotoByProductPhotoId.ProductPhotoId;

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

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


            return((ProductProductPhoto)mock);
        }
예제 #2
0
        ///<summary>
        ///  Update the Typed ProductPhoto Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance(TransactionManager tm, ProductPhoto mock)
        {
            ProductPhotoTest.UpdateMockInstance_Generated(tm, mock);

            // make any alterations necessary
            // (i.e. for DB check constraints, special test cases, etc.)
            SetSpecialTestData(mock);
        }
예제 #3
0
        ///<summary>
        ///  Returns a Typed ProductPhoto Entity with mock values.
        ///</summary>
        static public ProductPhoto CreateMockInstance(TransactionManager tm)
        {
            // get the default mock instance
            ProductPhoto mock = ProductPhotoTest.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>
        ///  Update the Typed ProductProductPhoto Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance_Generated(TransactionManager tm, ProductProductPhoto mock)
        {
            mock.Primary      = TestUtility.Instance.RandomBoolean();
            mock.ModifiedDate = TestUtility.Instance.RandomDateTime();

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

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

            //OneToOneRelationship
            ProductPhoto mockProductPhotoByProductPhotoId = ProductPhotoTest.CreateMockInstance(tm);

            DataRepository.ProductPhotoProvider.Insert(tm, mockProductPhotoByProductPhotoId);
            mock.ProductPhotoId = mockProductPhotoByProductPhotoId.ProductPhotoId;
        }