/////////////////////////////////////////////////////////////////////////////



        //////////////////////////////////////////////////////////////////////
        /// <summary>reads one external feed and inserts it locally</summary>
        //////////////////////////////////////////////////////////////////////
        [Test] public void DefaultHostInsertExternalFeed()
        {
            Tracing.TraceMsg("Entering DefaultHostInsertExternalFeed");

            if (this.strRemoteHost != null)
            {
                // remove old data
                DefaultHostDeleteAll();

                FeedQuery query   = new FeedQuery();
                Service   service = new Service();

                service.RequestFactory = (IGDataRequestFactory) new GDataLoggingRequestFactory(this.ServiceName, this.ApplicationName);
                query.Uri = new Uri(this.strRemoteHost);
                AtomFeed remoteFeed = service.Query(query);

                query.Uri = new Uri(this.defaultHost);
                AtomFeed localFeed = service.Query(query);

                foreach (AtomEntry remoteEntry in remoteFeed.Entries)
                {
                    localFeed.Entries.Add(remoteEntry);
                    Tracing.TraceInfo("added: " + remoteEntry.Title.Text);
                }
                bool f;

                foreach (AtomEntry localEntry in localFeed.Entries)
                {
                    f = localEntry.IsDirty();
                    Assert.AreEqual(true, f, "This entry better be dirty now");
                }

                f = localFeed.IsDirty();
                Assert.AreEqual(true, f, "This feed better be dirty now");

                localFeed.Publish();

                foreach (AtomEntry localEntry in localFeed.Entries)
                {
                    f = localEntry.IsDirty();
                    Assert.AreEqual(false, f, "This entry better NOT be dirty now");
                }

                f = localFeed.IsDirty();
                Assert.AreEqual(false, f, "This feed better NOT be dirty now");

                // requery
                localFeed = service.Query(query);

                foreach (AtomEntry localEntry in localFeed.Entries)
                {
                    AtomSource source = localEntry.Source;
                    Assert.AreEqual(source.Id.Uri.ToString(), remoteFeed.Id.Uri.ToString(), "This entry better has the same source ID than the remote feed");
                }
            }
        }