Provides tests for the and ProductDescription objects (entity, collection and repository).
Exemplo n.º 1
0
        ///<summary>
        ///  Returns a Typed ProductModelProductDescriptionCulture Entity with mock values.
        ///</summary>
        static public ProductModelProductDescriptionCulture CreateMockInstance_Generated(TransactionManager tm)
        {
            ProductModelProductDescriptionCulture mock = new ProductModelProductDescriptionCulture();

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

            //OneToOneRelationship
            Culture mockCultureByCultureId = CultureTest.CreateMockInstance(tm);

            DataRepository.CultureProvider.Insert(tm, mockCultureByCultureId);
            mock.CultureId = mockCultureByCultureId.CultureId;
            //OneToOneRelationship
            ProductDescription mockProductDescriptionByProductDescriptionId = ProductDescriptionTest.CreateMockInstance(tm);

            DataRepository.ProductDescriptionProvider.Insert(tm, mockProductDescriptionByProductDescriptionId);
            mock.ProductDescriptionId = mockProductDescriptionByProductDescriptionId.ProductDescriptionId;
            //OneToOneRelationship
            ProductModel mockProductModelByProductModelId = ProductModelTest.CreateMockInstance(tm);

            DataRepository.ProductModelProvider.Insert(tm, mockProductModelByProductModelId);
            mock.ProductModelId = mockProductModelByProductModelId.ProductModelId;

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

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


            return((ProductModelProductDescriptionCulture)mock);
        }
Exemplo n.º 2
0
        ///<summary>
        ///  Update the Typed ProductDescription Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance(TransactionManager tm, ProductDescription mock)
        {
            ProductDescriptionTest.UpdateMockInstance_Generated(tm, mock);

            // make any alterations necessary
            // (i.e. for DB check constraints, special test cases, etc.)
            SetSpecialTestData(mock);
        }
Exemplo n.º 3
0
        ///<summary>
        ///  Returns a Typed ProductDescription Entity with mock values.
        ///</summary>
        static public ProductDescription CreateMockInstance(TransactionManager tm)
        {
            // get the default mock instance
            ProductDescription mock = ProductDescriptionTest.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);
        }
Exemplo n.º 4
0
        ///<summary>
        ///  Update the Typed ProductModelProductDescriptionCulture Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance_Generated(TransactionManager tm, ProductModelProductDescriptionCulture mock)
        {
            mock.ModifiedDate = TestUtility.Instance.RandomDateTime();

            //OneToOneRelationship
            Culture mockCultureByCultureId = CultureTest.CreateMockInstance(tm);

            DataRepository.CultureProvider.Insert(tm, mockCultureByCultureId);
            mock.CultureId = mockCultureByCultureId.CultureId;

            //OneToOneRelationship
            ProductDescription mockProductDescriptionByProductDescriptionId = ProductDescriptionTest.CreateMockInstance(tm);

            DataRepository.ProductDescriptionProvider.Insert(tm, mockProductDescriptionByProductDescriptionId);
            mock.ProductDescriptionId = mockProductDescriptionByProductDescriptionId.ProductDescriptionId;

            //OneToOneRelationship
            ProductModel mockProductModelByProductModelId = ProductModelTest.CreateMockInstance(tm);

            DataRepository.ProductModelProvider.Insert(tm, mockProductModelByProductModelId);
            mock.ProductModelId = mockProductModelByProductModelId.ProductModelId;
        }