Esempio n. 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);
        }
Esempio n. 2
0
        ///<summary>
        ///  Returns a Typed EmployeeAddress Entity with mock values.
        ///</summary>
        static public EmployeeAddress CreateMockInstance_Generated(TransactionManager tm)
        {
            EmployeeAddress mock = new EmployeeAddress();

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

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

            DataRepository.AddressProvider.Insert(tm, mockAddressByAddressId);
            mock.AddressId = mockAddressByAddressId.AddressId;
            //OneToOneRelationship
            Employee mockEmployeeByEmployeeId = EmployeeTest.CreateMockInstance(tm);

            DataRepository.EmployeeProvider.Insert(tm, mockEmployeeByEmployeeId);
            mock.EmployeeId = mockEmployeeByEmployeeId.EmployeeId;

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

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


            return((EmployeeAddress)mock);
        }
Esempio n. 3
0
        ///<summary>
        ///  Update the Typed Address Entity with modified mock values.
        ///</summary>
        static public void UpdateMockInstance(TransactionManager tm, Address mock)
        {
            AddressTest.UpdateMockInstance_Generated(tm, mock);

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

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

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

            //OneToOneRelationship
            Employee mockEmployeeByEmployeeId = EmployeeTest.CreateMockInstance(tm);

            DataRepository.EmployeeProvider.Insert(tm, mockEmployeeByEmployeeId);
            mock.EmployeeId = mockEmployeeByEmployeeId.EmployeeId;
        }
Esempio n. 6
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;
        }