public SubresourceIntegrityTagHelperTest()
 {
     this.distributedCacheMock   = new Mock <IDistributedCache>(MockBehavior.Strict);
     this.hostingEnvironmentMock = new Mock <IHostingEnvironment>(MockBehavior.Strict);
     this.urlHelperMock          = new Mock <IUrlHelper>(MockBehavior.Strict);
     this.tagHelper = new TestSubresourceIntegrityTagHelper(
         this.distributedCacheMock.Object,
         this.hostingEnvironmentMock.Object,
         this.urlHelperMock.Object);
 }
        public SubresourceIntegrityTagHelperTest()
        {
            this.distributedCacheMock   = new Mock <IDistributedCache>(MockBehavior.Strict);
            this.hostingEnvironmentMock = new Mock <IHostingEnvironment>(MockBehavior.Strict);
            this.actionContextAccessor  = new Mock <IActionContextAccessor>(MockBehavior.Strict);
            this.urlHelperFactoryMock   = new Mock <IUrlHelperFactory>(MockBehavior.Strict);
            this.urlHelperMock          = new Mock <IUrlHelper>(MockBehavior.Strict);

            this.actionContextAccessor.SetupGet(x => x.ActionContext).Returns((ActionContext)null);
            this.urlHelperFactoryMock.Setup(x => x.GetUrlHelper(this.actionContextAccessor.Object.ActionContext)).Returns(this.urlHelperMock.Object);

            this.tagHelper = new TestSubresourceIntegrityTagHelper(
                this.distributedCacheMock.Object,
                this.hostingEnvironmentMock.Object,
                this.actionContextAccessor.Object,
                this.urlHelperFactoryMock.Object);
        }
        public SubresourceIntegrityTagHelperTest()
        {
            this.distributedCacheMock   = new Mock <IDistributedCache>(MockBehavior.Strict);
            this.webHostEnvironmentMock = new Mock <IWebHostEnvironment>(MockBehavior.Strict);
            this.actionContextAccessor  = new Mock <IActionContextAccessor>(MockBehavior.Strict);
            this.urlHelperFactoryMock   = new Mock <IUrlHelperFactory>(MockBehavior.Strict);
            this.urlHelperMock          = new Mock <IUrlHelper>(MockBehavior.Strict);
            this.htmlEncoderMock        = new Mock <HtmlEncoder>(MockBehavior.Strict);

            this.actionContextAccessor.SetupGet(x => x.ActionContext).Returns((ActionContext)null);
            this.urlHelperFactoryMock.Setup(x => x.GetUrlHelper(this.actionContextAccessor.Object.ActionContext)).Returns(this.urlHelperMock.Object);
            this.htmlEncoderMock.Setup(x => x.Encode(It.IsAny <string>())).Returns((string s) => s);

            this.tagHelper = new TestSubresourceIntegrityTagHelper(
                this.distributedCacheMock.Object,
                this.webHostEnvironmentMock.Object,
                this.actionContextAccessor.Object,
                this.urlHelperFactoryMock.Object,
                this.htmlEncoderMock.Object);
        }