コード例 #1
0
        public void Setup()
        {
            var httpClientMock = new Mock <IHttpClient>();

            jsonOutputer = new Moq.Mock <JsonOutputer>(httpClientMock.Object);
            jsonOutputer.Setup(x => x.WriteOutput(It.IsAny <HttpContext>())).Returns(Task.CompletedTask).Verifiable();
            htmlOutputer = new Moq.Mock <HtmlOutputer>(null, httpClientMock.Object);
            htmlOutputer.Setup(x => x.WriteOutput(It.IsAny <HttpContext>())).Returns(Task.CompletedTask).Verifiable();
            assetOutputer = new Moq.Mock <AssetOutputer>();
            assetOutputer.Setup(x => x.WriteOutput(It.IsAny <HttpContext>())).Returns(Task.CompletedTask).Verifiable();
            middleWare = new UmiMiddleware(null, new UmiMiddlewareOptions()
            {
                LocatorUrl = "/test"
            },
                                           jsonOutputer.Object,
                                           htmlOutputer.Object,
                                           assetOutputer.Object
                                           );
        }