Example #1
0
        public void GetComplianceMatrixShouldWork()
        {
            var raw = AssetRetriever.GetFileAndContent(AvailableTestingResources.GetComplianceMatrix);

            var obj = GetObj();

            var result = obj.Evaluate(raw.Contents, "Z:\\SomeDirectory\\Project", "Z:\\SomeDirectory\\Project\\BlockJs", "somefile.cshtml", false);
        }
        public void Page()
        {
            var raw = AssetRetriever.GetFileAndContent(AvailableTestingResources.TestingResource);

            var evaluator = new JsBlockContentEvaluator(new RemediatedBlockJsRemover());

            var result = evaluator.Evaluate(raw.Contents, PageEvaluationMode.Any, true);

            Assert.AreEqual(2, result.Length);
        }
        public void Page()
        {
            var raw = AssetRetriever.GetFileAndContent(AvailableTestingResources.TestingResource);

            var evaluator = new CssBlockContentEvaluator();

            var result = evaluator.Split(raw.Contents, PageEvaluationMode.Any, false);

            Assert.AreEqual(1, result.Length);
            Assert.AreEqual(6, result[0].Lines.Count);
        }
        public void Razor()
        {
            var raw = AssetRetriever.GetFileAndContent(AvailableTestingResources.TestingResource);

            var evaluator = new CssRazorEvaluator();

            var result = evaluator.Evaluate(string.Join("", raw.Contents));

            Assert.AreEqual(18, result.Count);

            Assert.AreEqual("{ id = \"ID\", style = \"width:50%\", @readonly = \"readonly\", onclick = \"test\" }", result[0].Value);
        }
        public void Block()
        {
            var raw = AssetRetriever.GetFileAndContent(AvailableTestingResources.TestingResource);

            var evaluator = new CssBlockEvaluator();

            var result = evaluator.Evaluate(string.Join("", raw.Contents));

            Assert.AreEqual(22, result.Count);

            Assert.AreEqual("<td style=\"width: 140px\" align=\"left\">", result[0].Value);
        }
        public void Razor()
        {
            var raw = AssetRetriever.GetFileAndContent(AvailableTestingResources.TestingResource);

            var evaluator = new JsRazorEvaluator();

            var result = evaluator.Evaluate(string.Join("", raw.Contents), JsAttributesProvider.Attributes);

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(1, result[0].InlineJavascriptTags.Count);

            Assert.AreEqual("onclick", result[0].AttributeName);
        }