コード例 #1
0
        private Location CreateAndLinkLocation(Location linkedLocation)
        {
            AnnotateService target = new AnnotateService(Parameters.TestDatabaseName); // TODO: Initialize to an appropriate value

            Location newPos = new Location();
            PopulateLocation(newPos, linkedLocation.ParentID);

            Location created_location = target.CreateLocation(newPos, new long[] { linkedLocation.ID });

            Assert.AreNotEqual(newPos.ID, created_location.ID);
            Assert.IsNull(target.GetLocationByID(newPos.ID));
            Assert.IsNotNull(target.GetLocationByID(created_location.ID));

            Assert.AreEqual(created_location.Links.Length,1);
            Assert.AreEqual(created_location.Links[0], linkedLocation.ID);

            long[] LinkedLocations = target.GetLinkedLocations(created_location.ID);
            Assert.AreEqual(1, LinkedLocations.Length);
            Assert.AreEqual(linkedLocation.ID, LinkedLocations[0]);

            return created_location;
        }