Exemplo n.º 1
0
        private string Transform(string less, TestPath path)
        {
            var engine = new EngineFactory().GetEngine();
            engine.CurrentDirectory = path.Directory;

            return engine.TransformToCss(less, path.FileName);
        }
Exemplo n.º 2
0
        private string Transform(string less, TestPath path)
        {
            var engine = new EngineFactory().GetEngine();

            engine.CurrentDirectory = path.Directory;

            return(engine.TransformToCss(less, path.FileName));
        }
Exemplo n.º 3
0
        private static ITestCaseData CreateTestCase(TestPath path, IDictionary <string, string> ignores)
        {
            var testCase = new TestCaseData(path).SetName(path.TestName);

            if (ignores.ContainsKey(path.Ignore))
            {
                testCase.Ignore(ignores[path.Ignore] ?? "From ignore.txt");
            }

            return(testCase);
        }
Exemplo n.º 4
0
        private ITestCaseData CreateTestCase(TestPath path, IDictionary<string, string> ignores)
        {
            var testCase = new TestCaseData(path).SetName(path.TestName);

            if (ignores.ContainsKey(path.Ignore))
            {
                testCase.Ignore(ignores[path.Ignore]);
            }

            return testCase;
        }
Exemplo n.º 5
0
        private IEnumerable <ITestCaseData> LoadTestCases()
        {
            var projectDir     = ConfigurationManager.AppSettings["lessJsProjectDirectory"];
            var differencesDir = ConfigurationManager.AppSettings["differencesDirectory"];
            var ignoreFile     = ConfigurationManager.AppSettings["ignoreFile"];

            var testPaths = TestPath.LoadAll(projectDir, differencesDir);
            var ignores   = Ignore.Load(ignoreFile);

            return(testPaths.Select(t => CreateTestCase(t, ignores)));
        }
Exemplo n.º 6
0
        public void TestCompatiblity(TestPath path)
        {
            var less        = File.ReadAllText(path.Less);
            var expectedCss = File.ReadAllText(path.Css);

            var css = Transform(less, path);

            if (CompareOutput(css, expectedCss) != 0)
            {
                Dump(path.DebugLess, less);
                Dump(path.ActualCss, css);
                Dump(path.ExpectedCss, expectedCss);
            }

            Assert.That(css, Is.EqualTo(expectedCss).Using <string>(new Comparison <string>(CompareOutput)));
        }
Exemplo n.º 7
0
        public void TestCompatiblity(TestPath path)
        {
            var less = File.ReadAllText(path.Less);
            var expectedCss = File.ReadAllText(path.Css);

            var css = Transform(less, path);

            if (CompareOutput(css, expectedCss) != 0)
            {
                Dump(path.DebugLess, less);
                Dump(path.ActualCss, css);
                Dump(path.ExpectedCss, expectedCss);
            }

            Assert.That(css, Is.EqualTo(expectedCss).Using<string>(CompareOutput));
        }