예제 #1
0
        public void TestFirstTimelineRequest()
        {
            string         endPoint = String.Format(endpointVerb, serviceUrl, verbDefault);
            HttpWebRequest request  = CreateRequest(endPoint);

            WebResponse response = request.GetResponse();

            DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(TimelineQueryResult));
            TimelineQueryResult        timelines  = (TimelineQueryResult)serializer.ReadObject(response.GetResponseStream());

            Assert.AreNotEqual <int>(0, timelines.d.Count, "No timelines returned");

            Assert.AreEqual <int>(1, timelines.d.Count, "Expecting one root timeline");
        }
예제 #2
0
        public void TestTimelineUniqueId()
        {
            string         endPoint = String.Format(endpointVerb, serviceUrl, verbDefault);
            HttpWebRequest request  = CreateRequest(endPoint);

            WebResponse response = request.GetResponse();

            DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(TimelineQueryResult));
            TimelineQueryResult        timelines  = (TimelineQueryResult)serializer.ReadObject(response.GetResponseStream());

            foreach (Chronozoom.Entities.Timeline timeline in timelines.d)
            {
                Assert.AreNotEqual <int>(0, timeline.UniqueID, "Timeline ID should not be 0");
            }
        }
예제 #3
0
        public void TestContentItemReferences()
        {
            string         endPoint = String.Format(endpointVerb, serviceUrl, verbDefault);
            HttpWebRequest request  = CreateRequest(endPoint);

            WebResponse response = request.GetResponse();

            DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(TimelineQueryResult));
            TimelineQueryResult        timelines  = (TimelineQueryResult)serializer.ReadObject(response.GetResponseStream());

            foreach (Chronozoom.Entities.Timeline timeline in timelines.d)
            {
                foreach (Chronozoom.Entities.Exhibit exhibit in timeline.Exhibits)
                {
                    if (exhibit.UniqueID == 118)
                    {
                        Assert.AreNotEqual <int>(0, exhibit.References.Count, "Expecting references");
                    }
                }
            }
        }