示例#1
0
        public void APITestChangeSetOpenCloseGet()
        {
            // intialize the connection.
            var apiInstance = new APIConnection("http://api06.dev.openstreetmap.org/",
                                                "osmsharp", "osmsharp");

            // opens the changeset.
            long changesetId = apiInstance.ChangeSetOpen("A test changeset!");

            // get the changeset.
            ChangeSetInfo simpleChangesetInfo =
                apiInstance.ChangeSetGet(changesetId);

            Assert.IsTrue(simpleChangesetInfo.Open);
            Assert.IsFalse(simpleChangesetInfo.ClosedAt.HasValue);

            // closes the current changeset.
            apiInstance.ChangeSetClose();

            // get the same changeset again!
            simpleChangesetInfo =
                apiInstance.ChangeSetGet(changesetId);
            Assert.IsFalse(simpleChangesetInfo.Open);
            Assert.IsTrue(simpleChangesetInfo.ClosedAt.HasValue);
        }