public void ResultOrderDoesNotEffectEtag()
        {
            var api = new GetKnownEndpointsApi();

            var request = new Request("GET", new Url("http://localhost/api/endpoints/known"));

            var localPage = new QueryResult <List <KnownEndpointsView> >(
                new List <KnownEndpointsView>(0),
                new QueryStatsInfo(LocalETag, 0))
            {
                InstanceId = LocalInstanceID
            };

            var remotePage = new QueryResult <List <KnownEndpointsView> >(
                new List <KnownEndpointsView>(0),
                new QueryStatsInfo(RemoteETag, 0))
            {
                InstanceId = RemoteInstanceId
            };

            var localFirst = api.AggregateResults(request, new[]
            {
                localPage,
                remotePage
            });
            var remoteFirst = api.AggregateResults(request, new[]
            {
                remotePage,
                localPage
            });

            Assert.AreEqual(localFirst.QueryStats.ETag, remoteFirst.QueryStats.ETag, "etag should not depend on result ordering");
        }
Esempio n. 2
0
        public void SetUp()
        {
            var api = new GetKnownEndpointsApi();

            var request = new Request("GET", new Url("http://localhost/api/endpoints/known"));

            Results = api.AggregateResults(request, GetData().ToArray());
        }