Exemple #1
0
        public void Get_NotFound()
        {
            //Create new ESRegAggConnection...
            IConnection conn = new ESResQSvcGetConn("Resource_NotFound", 404);

            ESResourceQueryService svc = this.GetService <ESResourceQueryService>(conn);

            Assert.ThrowsAny <Exception>(() =>
            {
                Resource actual = svc.Get("1010");
            });
        }
Exemple #2
0
        public void Get_ValidID()
        {
            //Create new ESRegAggConnection...

            IConnection conn = new ESResQSvcGetConn("Resource_101");

            //Expected Aggs
            Resource expected = StaticResourceData.GetRes101();

            ESResourceQueryService svc = this.GetService <ESResourceQueryService>(conn);
            Resource actual            = svc.Get("101");

            //Order does matter here, so we can compare the arrays
            //Assert.Equal(expected, actual);
            actual.Should().BeEquivalentTo(expected);
        }