public void CreateExpression()
        {
            var httpContext = new DefaultHttpContext();

            httpContext.Items.Add("graph", QueryRequestBuilder.New().SetQuery("{}").Create());

            _httpContextAcessorMock.Setup(f => f.HttpContext).Returns(httpContext);

            var queryProjection = new QueryProjectionTest(_httpContextAcessorMock.Object);

            queryProjection.CreateExpression <object>();

            queryProjection.Visited.Should().BeTrue();
        }
示例#2
0
        public void CreateExpressionCached()
        {
            var httpContext = new DefaultHttpContext();

            httpContext.Items.Add("graph", QueryRequestBuilder.New().SetQuery("{}").Create());

            _httpContextAcessorMock.Setup(f => f.HttpContext).Returns(httpContext);

            _memoryCacheMock.Setup(f => f.TryGetValue(It.IsAny <object>(), out cached)).Returns(true);

            var queryProjection = new QueryProjectionTest(_httpContextAcessorMock.Object, _memoryCacheMock.Object);

            queryProjection.CreateExpression <object>();

            queryProjection.Visited.Should().BeFalse();
        }