public EnrichWithAppIdCommandMiddlewareTests()
        {
            requestContext = Context.Anonymous(Mocks.App(appId));

            A.CallTo(() => contextProvider.Context)
            .Returns(requestContext);

            sut = new EnrichWithAppIdCommandMiddleware(contextProvider);
        }
        public EnrichWithAppIdCommandMiddlewareTests()
        {
            A.CallTo(() => contextProvider.Context)
            .Returns(appContext);

            var app = A.Fake <IAppEntity>();

            A.CallTo(() => app.Id).Returns(appId.Id);
            A.CallTo(() => app.Name).Returns(appId.Name);

            appContext.App = app;

            sut = new EnrichWithAppIdCommandMiddleware(contextProvider);
        }
Пример #3
0
        public EnrichWithAppIdCommandMiddlewareTests()
        {
            A.CallTo(() => httpContextAccessor.HttpContext)
            .Returns(httpContext);

            var appEntity = A.Fake <IAppEntity>();

            A.CallTo(() => appEntity.Id).Returns(appId.Id);
            A.CallTo(() => appEntity.Name).Returns(appId.Name);

            httpContext.Features.Set <IAppFeature>(new AppResolver.AppFeature(appEntity));

            sut = new EnrichWithAppIdCommandMiddleware(httpContextAccessor);
        }