public ExpandCssUrlsAssetTransformer_Tests()
        {
            fileSystem = new FakeFileSystem
            {
                "~/styles/asset.css"
            };

            urlGenerator = new Mock<IUrlGenerator>();
            urlGenerator.Setup(u => u.CreateRawFileUrl(It.IsAny<string>(), It.IsAny<string>()))
                        .Returns<string, string>((f, h) => "EXPANDED");

            transformer = new ExpandCssUrlsAssetTransformer(fileSystem, urlGenerator.Object);
            asset = new Mock<IAsset>();
            asset.SetupGet(a => a.Path).Returns("~/styles/asset.css");
        }
        public ExpandCssUrlsAssetTransformer_Tests()
        {
            fileSystem = new FakeFileSystem
            {
                "~/styles/asset.css"
            };

            urlGenerator = new Mock <IUrlGenerator>();
            urlGenerator.Setup(u => u.CreateRawFileUrl(It.IsAny <string>()))
            .Returns <string>(f => "EXPANDED");

            transformer = new ExpandCssUrlsAssetTransformer(fileSystem, urlGenerator.Object);
            asset       = new Mock <IAsset>();
            asset.SetupGet(a => a.Path).Returns("~/styles/asset.css");
        }
        public ExpandCssUrlsAssetTransformer_Tests()
        {
            directory    = new Mock <IDirectory>();
            file         = new Mock <IFile>();
            urlGenerator = new Mock <IUrlGenerator>();
            urlGenerator.Setup(u => u.CreateRawFileUrl(It.IsAny <string>(), It.IsAny <string>()))
            .Returns <string, string>((f, h) => "EXPANDED");
            directory.SetupGet(d => d.FullPath).Returns("~/styles");

            file.SetupGet(f => f.Exists).Returns(true);
            file.SetupGet(f => f.Directory).Returns(directory.Object);
            file.SetupGet(f => f.FullPath).Returns("~/styles/asset.css");
            file.Setup(f => f.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            .Returns(Stream.Null);

            transformer = new ExpandCssUrlsAssetTransformer(directory.Object, urlGenerator.Object);
            asset       = new Mock <IAsset>();
            asset.SetupGet(a => a.SourceFile).Returns(file.Object);
        }
        public ExpandCssUrlsAssetTransformer_Tests()
        {
            directory = new Mock<IDirectory>();
            file = new Mock<IFile>();
            urlGenerator = new Mock<IUrlGenerator>();
            urlGenerator.Setup(u => u.CreateRawFileUrl(It.IsAny<string>(), It.IsAny<string>()))
                        .Returns<string, string>((f, h) => "EXPANDED");
            directory.SetupGet(d => d.FullPath).Returns("~/styles");

            file.SetupGet(f => f.Exists).Returns(true);
            file.SetupGet(f => f.Directory).Returns(directory.Object);
            file.SetupGet(f => f.FullPath).Returns("~/styles/asset.css");
            file.Setup(f => f.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
                .Returns(Stream.Null);

            transformer = new ExpandCssUrlsAssetTransformer(directory.Object, urlGenerator.Object);
            asset = new Mock<IAsset>();
            asset.SetupGet(a => a.SourceFile).Returns(file.Object);
        }
Ejemplo n.º 5
0
        public ExpandCssUrlsAssetTransformer_Tests()
        {
            application = new Mock<ICassetteApplication>();
            var directory = new Mock<IDirectory>();
            file = new Mock<IFile>();
            urlGenerator = new Mock<IUrlGenerator>();
            application.SetupGet(a => a.RootDirectory)
                       .Returns(directory.Object);
            application.SetupGet(a => a.UrlGenerator)
                       .Returns(urlGenerator.Object);
            urlGenerator.Setup(u => u.CreateImageUrl(It.IsAny<string>(), It.IsAny<string>()))
                        .Returns<string, string>((f, h) => "EXPANDED");
            directory.Setup(d => d.GetFile(It.IsAny<string>()))
                     .Returns(file.Object);
            file.SetupGet(f => f.Exists).Returns(true);
            file.Setup(f => f.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
                .Returns(Stream.Null);

            transformer = new ExpandCssUrlsAssetTransformer(application.Object);
            asset = new Mock<IAsset>();
            asset.SetupGet(a => a.SourceFilename).Returns("~/styles/asset.css");
        }