Example #1
0
        public IEnumerable <AssetFile> Write(AssetPath asset)
        {
            if (asset.IsImage())
            {
                return(writeBinary(asset));
            }

            // TODO -- have to deal with the [package]:scripts/
            // think it'll just be testing
            return(writeTextualAsset(asset));
        }
Example #2
0
        protected override void beforeEach()
        {
            theAssetPath = new AssetPath("images/icon.gif");

            // Precondition here
            theAssetPath.IsImage().ShouldBeTrue();

            theFile = new AssetFile(theAssetPath.ToFullName())
            {
                FullPath = theAssetPath.ToFullName().ToFullPath()
            };

            MockFor <IAssetPipeline>().Stub(x => x.Find(theAssetPath))
            .Return(theFile);

            theReturnedFiles = ClassUnderTest.Write(theAssetPath);
        }
Example #3
0
        protected override void beforeEach()
        {
            var assetPath = new AssetPath("scripts/combo1.js");

            assetPath.IsImage().ShouldBeFalse();

            theFiles = new AssetFile[] {
                new AssetFile("script1.js")
                {
                    FullPath = "1.js"
                },
                new AssetFile("script2.js")
                {
                    FullPath = "2.js"
                },
                new AssetFile("script3.js")
                {
                    FullPath = "3.js"
                },
                new AssetFile("script4.js")
                {
                    FullPath = "4.js"
                },
            };

            MockFor <IContentPlanCache>().Stub(x => x.SourceFor(assetPath))
            .Return(MockFor <IContentSource>());

            MockFor <IContentSource>().Expect(x => x.GetContent(MockFor <IContentPipeline>()))
            .Return(theContent);

            MockFor <IContentSource>().Stub(x => x.Files).Return(theFiles);


            theReturnedFiles = ClassUnderTest.Write(assetPath);
        }