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

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

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

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

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

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

            Assert.Equal(7, attribute.GetData(null, null).Count());
        }
Beispiel #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")));
        }
Beispiel #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));
        }