Provides tests for the and Store objects (entity, collection and repository).
        ///<summary>
        ///  Returns a Typed StoreContact Entity with mock values.
        ///</summary>
        static public StoreContact CreateMockInstance_Generated(TransactionManager tm)
        {
            StoreContact mock = new StoreContact();

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

            //OneToOneRelationship
            Contact mockContactByContactId = ContactTest.CreateMockInstance(tm);

            DataRepository.ContactProvider.Insert(tm, mockContactByContactId);
            mock.ContactId = mockContactByContactId.ContactId;
            //OneToOneRelationship
            ContactType mockContactTypeByContactTypeId = ContactTypeTest.CreateMockInstance(tm);

            DataRepository.ContactTypeProvider.Insert(tm, mockContactTypeByContactTypeId);
            mock.ContactTypeId = mockContactTypeByContactTypeId.ContactTypeId;
            //OneToOneRelationship
            Store mockStoreByCustomerId = StoreTest.CreateMockInstance(tm);

            DataRepository.StoreProvider.Insert(tm, mockStoreByCustomerId);
            mock.CustomerId = mockStoreByCustomerId.CustomerId;

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

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


            return((StoreContact)mock);
        }
Exemple #2
0
        ///<summary>
        ///  Update the Typed Store Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance(TransactionManager tm, Store mock)
        {
            StoreTest.UpdateMockInstance_Generated(tm, mock);

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

            //OneToOneRelationship
            Contact mockContactByContactId = ContactTest.CreateMockInstance(tm);

            DataRepository.ContactProvider.Insert(tm, mockContactByContactId);
            mock.ContactId = mockContactByContactId.ContactId;

            //OneToOneRelationship
            ContactType mockContactTypeByContactTypeId = ContactTypeTest.CreateMockInstance(tm);

            DataRepository.ContactTypeProvider.Insert(tm, mockContactTypeByContactTypeId);
            mock.ContactTypeId = mockContactTypeByContactTypeId.ContactTypeId;

            //OneToOneRelationship
            Store mockStoreByCustomerId = StoreTest.CreateMockInstance(tm);

            DataRepository.StoreProvider.Insert(tm, mockStoreByCustomerId);
            mock.CustomerId = mockStoreByCustomerId.CustomerId;
        }