Provides tests for the and AddressType objects (entity, collection and repository).
Пример #1
0
        ///<summary>
        ///  Returns a Typed VendorAddress Entity with mock values.
        ///</summary>
        static public VendorAddress CreateMockInstance_Generated(TransactionManager tm)
        {
            VendorAddress mock = new VendorAddress();

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

            //OneToOneRelationship
            Address mockAddressByAddressId = AddressTest.CreateMockInstance(tm);

            DataRepository.AddressProvider.Insert(tm, mockAddressByAddressId);
            mock.AddressId = mockAddressByAddressId.AddressId;
            //OneToOneRelationship
            AddressType mockAddressTypeByAddressTypeId = AddressTypeTest.CreateMockInstance(tm);

            DataRepository.AddressTypeProvider.Insert(tm, mockAddressTypeByAddressTypeId);
            mock.AddressTypeId = mockAddressTypeByAddressTypeId.AddressTypeId;
            //OneToOneRelationship
            Vendor mockVendorByVendorId = VendorTest.CreateMockInstance(tm);

            DataRepository.VendorProvider.Insert(tm, mockVendorByVendorId);
            mock.VendorId = mockVendorByVendorId.VendorId;

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

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


            return((VendorAddress)mock);
        }
Пример #2
0
        ///<summary>
        ///  Update the Typed AddressType Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance(TransactionManager tm, AddressType mock)
        {
            AddressTypeTest.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 AddressType Entity with mock values.
        ///</summary>
        static public AddressType CreateMockInstance(TransactionManager tm)
        {
            // get the default mock instance
            AddressType mock = AddressTypeTest.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 VendorAddress Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance_Generated(TransactionManager tm, VendorAddress mock)
        {
            mock.ModifiedDate = TestUtility.Instance.RandomDateTime();

            //OneToOneRelationship
            Address mockAddressByAddressId = AddressTest.CreateMockInstance(tm);

            DataRepository.AddressProvider.Insert(tm, mockAddressByAddressId);
            mock.AddressId = mockAddressByAddressId.AddressId;

            //OneToOneRelationship
            AddressType mockAddressTypeByAddressTypeId = AddressTypeTest.CreateMockInstance(tm);

            DataRepository.AddressTypeProvider.Insert(tm, mockAddressTypeByAddressTypeId);
            mock.AddressTypeId = mockAddressTypeByAddressTypeId.AddressTypeId;

            //OneToOneRelationship
            Vendor mockVendorByVendorId = VendorTest.CreateMockInstance(tm);

            DataRepository.VendorProvider.Insert(tm, mockVendorByVendorId);
            mock.VendorId = mockVendorByVendorId.VendorId;
        }