CreateMockInstance() static public method

Returns a Typed ProductPhoto Entity with mock values.
static public CreateMockInstance ( TransactionManager tm ) : ProductPhoto
tm TransactionManager
return Nettiers.AdventureWorks.Entities.ProductPhoto
        ///<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);
        }
        ///<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;
        }