Example #1
0
        public void FindByLevelTest()
        {
            // List<TaxClassification> taxClassList = dataServiceTestCases.FindAllEntities(new TaxClassification()) as List<TaxClassification>;
            IEnumerable <IEntity> taxClassList = dataServiceTestCases.FindAllEntities(new TaxClassification());

            try
            {
                //TaxClassification taxClassification = new TaxClassification
                //{
                //    Level = taxClassList[0].Level
                //};
                string lvl = "";
                foreach (TaxClassification tx in taxClassList)
                {
                    lvl = tx.Level;
                    break;
                }

                TaxClassification taxClassification = new TaxClassification
                {
                    Level = lvl
                };
                IEnumerable <IEntity> taxClassifications = dataServiceTestCases.FindByLevelEntities(taxClassification);
                Assert.IsNotNull(taxClassifications);
                Assert.IsTrue(taxClassifications.Count() > 0);
            }
            catch (System.Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
Example #2
0
        public void FindByParentIdTest()
        {
            // List<TaxClassification> taxClassList = dataServiceTestCases.FindAllEntities(new TaxClassification()) as List<TaxClassification>;
            IEnumerable <IEntity> taxClassList = dataServiceTestCases.FindAllEntities(new TaxClassification()) as IEnumerable <IEntity>;

            try
            {
                //TaxClassification taxClassification = new TaxClassification
                //{
                //    ParentRef = taxClassList[0].ParentRef
                //};
                ReferenceType pRef = new ReferenceType();
                foreach (TaxClassification tx in taxClassList)
                {
                    pRef = tx.ParentRef;
                    break;
                }

                TaxClassification taxClassification = new TaxClassification
                {
                    ParentRef = pRef
                };
                IEnumerable <IEntity> taxClassifications = dataServiceTestCases.FindByParentIdEntities(taxClassification);
                Assert.IsNotNull(taxClassifications);
                Assert.IsTrue(taxClassifications.Count() > 0);
            }
            catch (System.Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }
 public void FindByParentIdTestNullParentId()
 {
     TaxClassification taxClassification = new TaxClassification
     {
         ParentRef = null
     };
     IEnumerable<TaxClassification> taxClassifications = dataServiceTestCases.FindByParentIdEntities(taxClassification) as IEnumerable<TaxClassification>;
     Assert.Fail();
 }
 public void FindByLevelTestInvalidLevel()
 {
     TaxClassification taxClassification = new TaxClassification
     {
         Level = "level"
     };
     IEnumerable<TaxClassification> taxClassifications = dataServiceTestCases.FindByLevelEntities(taxClassification) as IEnumerable<TaxClassification>;
     Assert.Fail();
 }
 public void FindByParentIdTestInvalidParentId()
 {
     TaxClassification taxClassification = new TaxClassification
     {
         ParentRef = new ReferenceType
         {
             Value = "parent"
         }
     };
     IEnumerable<TaxClassification> taxClassifications = dataServiceTestCases.FindByParentIdEntities(taxClassification) as IEnumerable<TaxClassification>;
     Assert.Fail();
 }
Example #6
0
        [TestMethod()]//INFO: Fails when run in group
        public void FindByParentIdQboTestNullEntity()
        {
            TaxClassification taxClassification = null;
            ManualResetEvent  manualEvent       = new ManualResetEvent(false);

            qboService.OnFindByParentIdAsyncCompleted = (sender, e) =>
            {
                Assert.IsNotNull(e);
                Assert.IsNotNull(e.Error);
                manualEvent.Set();
            };
            qboService.FindByParentIdAsync(taxClassification);
            manualEvent.WaitOne(60000);
        }
Example #7
0
        public void FindByLevelQboTestInvalidLevel()
        {
            ManualResetEvent  manualEvent       = new ManualResetEvent(false);
            TaxClassification taxClassification = new TaxClassification
            {
                Level = "level"
            };

            qboService.OnFindByLevelAsyncCompleted = (sender, e) =>
            {
                Assert.IsNotNull(e);
                Assert.IsNotNull(e.Error);
                manualEvent.Set();
            };
            qboService.FindByLevelAsync(taxClassification);
            manualEvent.WaitOne(30000);
        }
 public void FindByParentIdTest()
 {
     List<TaxClassification> taxClassList = dataServiceTestCases.FindAllEntities(new TaxClassification()) as List<TaxClassification>;
     try
     {
         TaxClassification taxClassification = new TaxClassification
         {
             ParentRef = taxClassList[0].ParentRef
         };
         IEnumerable<IEntity> taxClassifications = dataServiceTestCases.FindByParentIdEntities(taxClassification);
         Assert.IsNotNull(taxClassifications);
         Assert.IsTrue(taxClassifications.Count() > 0);
     }
     catch (System.Exception ex)
     {
         Assert.Fail(ex.ToString());
     }
 }
Example #9
0
        public void FindByParentIdQboTest()
        {
            List <TaxClassification> taxClassList      = qboService.FindAll(new TaxClassification()).ToList();
            TaxClassification        taxClassification = new TaxClassification
            {
                ParentRef = taxClassList[0].ParentRef
            };
            ManualResetEvent manualEvent = new ManualResetEvent(false);

            qboService.OnFindByParentIdAsyncCompleted = (sender, e) =>
            {
                Assert.IsNotNull(e);
                Assert.IsNotNull(e.Entities);
                Assert.IsTrue(e.Entities.Count > 0);
                manualEvent.Set();
            };
            qboService.FindByParentIdAsync(taxClassification);
            manualEvent.WaitOne(30000);
        }
Example #10
0
        public void FindByarentIdQboTestInvalidParentId()
        {
            ManualResetEvent  manualEvent       = new ManualResetEvent(false);
            TaxClassification taxClassification = new TaxClassification
            {
                ParentRef = new ReferenceType
                {
                    Value = "parent"
                }
            };

            qboService.OnFindByParentIdAsyncCompleted = (sender, e) =>
            {
                Assert.IsNotNull(e);
                Assert.IsNotNull(e.Error);
                manualEvent.Set();
            };
            qboService.FindByParentIdAsync(taxClassification);
            manualEvent.WaitOne(30000);
        }
Example #11
0
        public void FindAllTaxClassificationsTest()
        {
            TaxClassification taxClassification = new TaxClassification();

            try
            {
                // Used to signal the waiting test thread that a async operation have completed.
                ManualResetEvent manualEvent = new ManualResetEvent(false);
                qboService.OnFindAllAsyncCompleted = (sender, e) =>
                {
                    Assert.IsNotNull(e);
                    Assert.IsNotNull(e.Entities);
                    Assert.IsTrue(e.Entities.Count <= 10);
                    manualEvent.Set();
                };
                qboService.FindAllAsync(taxClassification);
                manualEvent.WaitOne(30000);
            }
            catch (System.Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
        }