예제 #1
0
        public async Task EnforceExtension_Throws(string fileName, params string[] extensions)
        {
            var minifier = new EnforceFileExtensions(extensions);
            var context  = new Mock <IAssetContext>().SetupAllProperties();

            context.Object.Content = new Dictionary <string, byte[]> {
                { fileName, new byte[0] }
            };
            var options = new Mock <WebOptimizerOptions>();

            await Assert.ThrowsAsync <NotSupportedException>(async() => await minifier.ExecuteAsync(context.Object));
        }
예제 #2
0
        public async Task EnforceExtension_Success(string fileName, params string[] extensions)
        {
            var minifier = new EnforceFileExtensions(extensions);
            var context  = new Mock <IAssetContext>().SetupAllProperties();

            context.Object.Content = new Dictionary <string, byte[]> {
                { fileName, new byte[0] }
            };
            var options = new Mock <WebOptimizerOptions>();

            await minifier.ExecuteAsync(context.Object);

            Assert.Equal(fileName, context.Object.Content.First().Key);
        }