Пример #1
0
        public void Can_handle_WorkList_extent_on_delete()
        {
            InsertFeature(_featureClass0, _poly0);
            InsertFeature(_featureClass1, _poly1);

            try
            {
                IWorkList workList  = new IssueWorkList(_repository, "work list");
                Envelope  newExtent = GeometryUtils.Union(_poly0.Extent, _poly1.Extent);
                AssertEqual(newExtent, workList.Extent);

                Assert.AreEqual(2, workList.GetItems().ToList().Count);

                DeleteRow(_featureClass1);

                var inserts = new Dictionary <Table, List <long> >();
                var deletes = new Dictionary <Table, List <long> > {
                    { _table1, new List <long> {
                          1
                      } }
                };
                var updates = new Dictionary <Table, List <long> >();

                ((IRowCache)workList).ProcessChanges(inserts, deletes, updates);

                Assert.AreEqual(1, workList.GetItems().ToList().Count);

                AssertEqual(_poly0.Extent, workList.Extent);
            }
            finally
            {
                DeleteAllRows(_featureClass0);
                DeleteAllRows(_featureClass1);
            }
        }
Пример #2
0
        public void Foo()
        {
            InsertFeature(_featureClass0, _poly0);
            InsertFeature(_featureClass0, _poly0);

            try
            {
                IWorkList workList = new IssueWorkList(_repository, "work list");

                List <IWorkItem> items = workList.GetItems().ToList();
                Assert.AreEqual(2, items.Count);

                IWorkItem item = items[0];
                item.Visited = true;
                item.Status  = WorkItemStatus.Done;

                workList.SetStatus(item, WorkItemStatus.Done);

                item = workList.GetItems(null, true).ToList()[0];

                // WorkItemStatus.Done
                Assert.AreEqual(WorkItemStatus.Done, item.Status);
            }
            finally
            {
                DeleteAllRows(_featureClass0);
            }
        }
Пример #3
0
        public void Can_handle_WorkList_extent_on_update()
        {
            InsertFeature(_featureClass0, _poly0);
            InsertFeature(_featureClass1, _poly0);

            try
            {
                IWorkList workList = new IssueWorkList(_repository, "work list");
                AssertEqual(_poly0.Extent, workList.Extent);

                Assert.AreEqual(2, workList.GetItems().ToList().Count);

                UpdateFeatureGeometry(_featureClass0, _poly1);
                UpdateFeatureGeometry(_featureClass1, _poly1);

                var inserts = new Dictionary <Table, List <long> >();
                var deletes = new Dictionary <Table, List <long> >();
                var updates = new Dictionary <Table, List <long> > {
                    { _table0, new List <long> {
                          1
                      } }, { _table1, new List <long> {
                                 1
                             } }
                };

                ((IRowCache)workList).ProcessChanges(inserts, deletes, updates);

                var items = workList.GetItems().ToList();
                Assert.AreEqual(2, items.Count);

                List <long> ids    = items.Select(i => i.OID).ToList().ConvertAll(i => (long)i);
                QueryFilter filter = GdbQueryUtils.CreateFilter(ids);

                foreach (IWorkItem item in workList.GetItems(filter))
                {
                    AssertEqual(_poly1.Extent, item.Extent);
                }

                AssertEqual(_poly1.Extent, workList.Extent);
            }
            finally
            {
                DeleteAllRows(_featureClass0);
                DeleteAllRows(_featureClass1);
            }
        }