public void build_a_plan_for_a_single_file_with_no_transformers_of_any_kind() { ContentPlanScenario.For(x => { x.SingleAssetFileName = "script1.js"; }) .ShouldMatch(@" FileRead:script1.js "); }
public void apply_a_mix_of_tranformations_and_combos_batched_global_transform_to_a_combo_2() { ContentPlanScenario.For(x => { x.TransformerPolicy <BatchedGlobalJsTransformer>(); x.TransformerPolicy <BatchedGlobalCssTransformer>(); x.JsTransformer <StubTransformer>(ActionType.Transformation, ".stub"); x.JsTransformer <CoffeeTransformer>(ActionType.BatchedTransformation, ".coffee"); x.CombinationOfScriptsIs("combo1", "script1.coffee.js", "script2.stub.coffee.js", "script3.js", "script4.coffee.js", "script5.stub.js"); }) .ShouldMatch(@" Transform:ATransformer Combination Transform:CoffeeTransformer Combination FileRead:script1.coffee.js Transform:StubTransformer FileRead:script2.stub.coffee.js FileRead:script3.js Transform:CoffeeTransformer FileRead:script4.coffee.js Transform:StubTransformer FileRead:script5.stub.js "); }
public static ContentPlanShouldBeExpression For(Action <IContentPlanScenario> configure) { var scenario = new ContentPlanScenario(); configure(scenario); var plan = scenario.BuildPlan(); return(new ContentPlanShouldBeExpression(plan)); }
public void multiple_files_should_be_combined() { ContentPlanScenario.For( x => { x.CombinationOfScriptsIs("my-scripts", "script1.js", "script2.js", "script3.js"); }) .ShouldMatch(@" Combination FileRead:script1.js FileRead:script2.js FileRead:script3.js "); }
public void build_a_plan_for_a_single_file_that_does_not_match_any_transforms() { ContentPlanScenario.For(x => { x.SingleAssetFileName = "script1.js"; x.JsTransformer <CoffeeTransformer>(ActionType.Transformation, ".coffee"); }) .ShouldMatch(@" FileRead:script1.js "); }
public void build_a_plan_for_a_single_file_that_has_a_single_transform_that_is_not_batched() { ContentPlanScenario.For(x => { x.SingleAssetFileName = "script1.coffee.js"; x.JsTransformer <CoffeeTransformer>(ActionType.Transformation, ".coffee"); }) .ShouldMatch(@" Transform:CoffeeTransformer FileRead:script1.coffee.js "); }
public void apply_a_non_batched_global_transform_to_a_single_file() { ContentPlanScenario.For(x => { x.TransformerPolicy <NotBatchedGlobalJsTransformer>(); x.TransformerPolicy <NotBatchedGlobalCssTransformer>(); x.SingleAssetFileName = "script1.js"; }) .ShouldMatch(@" Transform:BTransformer FileRead:script1.js "); }
public void simple_batch_transform_scenario() { ContentPlanScenario.For(x => { x.JsTransformer <CoffeeTransformer>(ActionType.BatchedTransformation, ".coffee"); x.CombinationOfScriptsIs("my-scripts", "script1.coffee.js", "script2.coffee.js", "script3.coffee.js"); }) .ShouldMatch( @" Transform:CoffeeTransformer Combination FileRead:script1.coffee.js FileRead:script2.coffee.js FileRead:script3.coffee.js "); }
public void should_only_pick_up_transforms_for_the_right_mimetype() { ContentPlanScenario.For(x => { x.SingleAssetFileName = "script1.a.coffee.js"; x.JsTransformer <CoffeeTransformer>(ActionType.Transformation, ".coffee"); x.JsTransformer <ATransformer>(ActionType.Transformation, ".a"); x.CssTransformer <AnotherTransformer>(ActionType.Transformation, ".a"); }) .ShouldMatch( @" Transform:CoffeeTransformer Transform:ATransformer FileRead:script1.a.coffee.js "); }
public void apply_a_batched_global_transform_to_a_combo() { ContentPlanScenario.For(x => { x.TransformerPolicy <BatchedGlobalJsTransformer>(); x.TransformerPolicy <BatchedGlobalCssTransformer>(); x.CombinationOfScriptsIs("combo1", "script1.js", "script2.js", "script3.js"); }) .ShouldMatch(@" Transform:ATransformer Combination FileRead:script1.js FileRead:script2.js FileRead:script3.js "); }
public void more_complex_batch_transform_scenario_4() { ContentPlanScenario.For(x => { x.JsTransformer <CoffeeTransformer>(ActionType.BatchedTransformation, ".coffee"); x.CombinationOfScriptsIs("my-scripts", "a.js", "b.js", "script1.coffee.js", "script2.coffee.js", "script3.coffee.js", "script4.js", "script5.js", "script6.coffee.js"); }) .ShouldMatch( @" Combination FileRead:a.js FileRead:b.js Transform:CoffeeTransformer Combination FileRead:script1.coffee.js FileRead:script2.coffee.js FileRead:script3.coffee.js FileRead:script4.js FileRead:script5.js Transform:CoffeeTransformer FileRead:script6.coffee.js "); }