Ejemplo n.º 1
0
        public void FileNameIsSameForAllTestsInFile()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile1.js");

            Assert.True(attribute.GetData(null, null).All(arguments => arguments[2].Equals(@"..\..\TestFile1.js")));
        }
Ejemplo n.º 2
0
        public void ActionIsFunctionNameOnlyIfDefaultPattern()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile1.js");

            Assert.Equal("function1", attribute.GetData(null, null).First()[1]);
        }
Ejemplo n.º 3
0
        public void ActionIsFunctionNameOnlyIfCustomPattern()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile2.js", @"test_[\w\d]+");

            Assert.Equal("test_function1", attribute.GetData(null, null).First()[1]);
        }
Ejemplo n.º 4
0
        public void UseCustomExpressionIfSpecified()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile2.js", @"test_[\w\d]+");

            Assert.Equal(4, attribute.GetData(null, null).Count());
        }
Ejemplo n.º 5
0
        public void ContextIsFileNameWithoutExtension()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile1.js");

            Assert.True(attribute.GetData(null, null).All(arguments => arguments[0].Equals("TestFile1")));
        }
Ejemplo n.º 6
0
        public void AllNamedFunctionsAreTestsByDefault()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile1.js");

            Assert.Equal(7, attribute.GetData(null, null).Count());
        }
Ejemplo n.º 7
0
        public void ThrowArgumentExceptionOnBadRegexExpression()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile1.js", "(");

            Assert.Throws <ArgumentException>(() => attribute.GetData(null, null));
        }
        public void FileNameIsSameForAllTestsInFile()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile1.js");

            Assert.True(attribute.GetData(null, null).All(arguments => arguments[2].Equals(@"..\..\TestFile1.js")));
        }
Ejemplo n.º 9
0
        public void ThrowFileNotFoundExceptionIfFileDoesNotExist()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\DoesNotExist.js");

            Assert.Throws <FileNotFoundException>(() => attribute.GetData(null, null));
        }
        public void ActionIsFunctionNameOnlyIfDefaultPattern()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile1.js");

            Assert.Equal("function1", attribute.GetData(null, null).First()[1]);
        }
        public void ActionIsFunctionNameOnlyIfCustomPattern()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile2.js", @"test_[\w\d]+");

            Assert.Equal("test_function1", attribute.GetData(null, null).First()[1]);
        }
        public void ContextIsFileNameWithoutExtension()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile1.js");

            Assert.True(attribute.GetData(null, null).All(arguments => arguments[0].Equals("TestFile1")));
        }
        public void UseCustomExpressionIfSpecified()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile2.js", @"test_[\w\d]+");

            Assert.Equal(4, attribute.GetData(null, null).Count());
        }
        public void ThrowArgumentExceptionOnBadRegexExpression()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile1.js", "(");

            Assert.Throws<ArgumentException>(() => attribute.GetData(null, null));
        }
        public void AllNamedFunctionsAreTestsByDefault()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile1.js");

            Assert.Equal(7, attribute.GetData(null, null).Count());
        }
        public void ThrowFileNotFoundExceptionIfFileDoesNotExist()
        {
            var attribute = new JavaScriptTestFileAttribute(@"..\..\DoesNotExist.js");

            Assert.Throws<FileNotFoundException>(() => attribute.GetData(null, null));
        }