public void FileNameIsSameForAllTestsInFile() { var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile1.js"); Assert.True(attribute.GetData(null, null).All(arguments => arguments[2].Equals(@"..\..\TestFile1.js"))); }
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 UseCustomExpressionIfSpecified() { var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile2.js", @"test_[\w\d]+"); Assert.Equal(4, attribute.GetData(null, null).Count()); }
public void ContextIsFileNameWithoutExtension() { var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile1.js"); Assert.True(attribute.GetData(null, null).All(arguments => arguments[0].Equals("TestFile1"))); }
public void AllNamedFunctionsAreTestsByDefault() { var attribute = new JavaScriptTestFileAttribute(@"..\..\TestFile1.js"); Assert.Equal(7, attribute.GetData(null, null).Count()); }
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"))); }
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)); }