Provides tests for the and Culture objects (entity, collection and repository).
示例#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);
        }
示例#2
0
        ///<summary>
        ///  Update the Typed Culture Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance(TransactionManager tm, Culture mock)
        {
            CultureTest.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 Culture Entity with mock values.
        ///</summary>
        static public Culture CreateMockInstance(TransactionManager tm)
        {
            // get the default mock instance
            Culture mock = CultureTest.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);
        }
示例#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;
        }