Skip to content

Commit a7f5da7

Browse files
committed
Added nunit, relative paths, and travis ci config
1 parent 8e09dd8 commit a7f5da7

File tree

8 files changed

+61
-22
lines changed

8 files changed

+61
-22
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ publish/
9898

9999
# NuGet Packages Directory
100100
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
101-
#packages/
101+
packages/
102+
.nuget/
103+
.nuget/packages.config
102104

103105
# Windows Azure Build Output
104106
csx

ListingBuilder/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class Program
1212
{
1313
static void Main(string[] args)
1414
{
15-
string readPath = @"C:\Projects\Visual-Studio-jQuery-Code-Snippets\jQueryCodeSnippets";
16-
string listingFilePath = @"C:\Projects\Visual-Studio-jQuery-Code-Snippets\SnippetListing.html";
15+
string readPath = @"..\..\..\jQueryCodeSnippets";
16+
string listingFilePath = @"..\..\..\SnippetListing.html";
1717
StringBuilder tableSb = new StringBuilder();
1818

1919
tableSb.AppendLine("<table>");

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Visual Studio jQuery Code Snippets
22

3-
I have updated the popular jQuery code snippets for use in Visual Studio 2012, 2013, and 2015. See a demo video on YouTube here: http://www.youtube.com/watch?v=Escy0hbEkI8&hd=1
3+
I have updated the popular jQuery code snippets for use in Visual Studio 2012, 2013, and 2015. See a demo video on YouTube here: <http://www.youtube.com/watch?v=Escy0hbEkI8&hd=1>
44

55
Most of these snippets were originally developed by [John Sheehan](http://jquerysnippets.codeplex.com/) for Visual Studio 2010. Credit given where due.
66

@@ -31,4 +31,4 @@ There are over 130 code snippets for jQuery included. Check out the [snippet lis
3131

3232
## Contributing
3333

34-
Please feel free to submit pull requests to the `dev` branch.
34+
Please feel free to submit pull requests to the `master` branch.

Tests/SnippetTests.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
using System;
22
using System.IO;
33
using System.Xml;
4-
using Microsoft.VisualStudio.TestTools.UnitTesting;
4+
using NUnit.Framework;
55

66
namespace Tests
77
{
8-
[TestClass]
8+
[TestFixture]
99
public class SnippetTests
1010
{
1111
// --- CONFIGURATION ---
12-
// update path to local project directory
13-
private string m_path = @"C:\Projects\Visual-Studio-jQuery-Code-Snippets\jQueryCodeSnippets";
12+
private string m_path = @"..\..\..\jQueryCodeSnippets";
1413
private string m_helpUrl = "https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets";
1514
private string m_version = "1.4.0";
1615
// --- END CONFIGURATION ---
1716

18-
[TestMethod]
17+
[Test]
1918
public void SnippetTitlesAreCorrect()
2019
{
2120
foreach (var snippetFile in Directory.EnumerateFiles(m_path, "*.snippet", SearchOption.AllDirectories))
@@ -33,7 +32,7 @@ public void SnippetTitlesAreCorrect()
3332
}
3433
}
3534

36-
[TestMethod]
35+
[Test]
3736
public void SnippetShortcutsAreCorrect()
3837
{
3938
foreach (var snippetFile in Directory.EnumerateFiles(m_path, "*.snippet", SearchOption.AllDirectories))
@@ -51,7 +50,7 @@ public void SnippetShortcutsAreCorrect()
5150
}
5251
}
5352

54-
[TestMethod]
53+
[Test]
5554
public void SnippetsHaveDescriptions()
5655
{
5756
foreach (var snippetFile in Directory.EnumerateFiles(m_path, "*.snippet", SearchOption.AllDirectories))
@@ -67,7 +66,7 @@ public void SnippetsHaveDescriptions()
6766
}
6867
}
6968

70-
[TestMethod]
69+
[Test]
7170
public void SnippetsHaveAuthors()
7271
{
7372
foreach (var snippetFile in Directory.EnumerateFiles(m_path, "*.snippet", SearchOption.AllDirectories))
@@ -83,7 +82,7 @@ public void SnippetsHaveAuthors()
8382
}
8483
}
8584

86-
[TestMethod]
85+
[Test]
8786
public void SnippetsHaveHelpUrls()
8887
{
8988
var helpUrl = "https://github.com/kspearrin/Visual-Studio-jQuery-Code-Snippets";
@@ -101,7 +100,7 @@ public void SnippetsHaveHelpUrls()
101100
}
102101
}
103102

104-
[TestMethod]
103+
[Test]
105104
public void SnippetsAreProperFormattedXml()
106105
{
107106
foreach (var snippetFile in Directory.EnumerateFiles(m_path, "*.snippet", SearchOption.AllDirectories))
@@ -111,7 +110,7 @@ public void SnippetsAreProperFormattedXml()
111110
}
112111
}
113112

114-
[TestMethod]
113+
[Test]
115114
public void SnippetsHaveCorrectVersion()
116115
{
117116
foreach (var snippetFile in Directory.EnumerateFiles(m_path, "*.snippet", SearchOption.AllDirectories))

Tests/Tests.csproj

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,25 @@
3535
<WarningLevel>4</WarningLevel>
3636
</PropertyGroup>
3737
<ItemGroup>
38+
<Reference Include="nunit.core">
39+
<HintPath>..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.dll</HintPath>
40+
<Private>False</Private>
41+
</Reference>
42+
<Reference Include="nunit.core.interfaces">
43+
<HintPath>..\packages\NUnitTestAdapter.2.0.0\lib\nunit.core.interfaces.dll</HintPath>
44+
<Private>False</Private>
45+
</Reference>
46+
<Reference Include="nunit.framework">
47+
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
48+
</Reference>
49+
<Reference Include="nunit.util">
50+
<HintPath>..\packages\NUnitTestAdapter.2.0.0\lib\nunit.util.dll</HintPath>
51+
<Private>False</Private>
52+
</Reference>
53+
<Reference Include="NUnit.VisualStudio.TestAdapter">
54+
<HintPath>..\packages\NUnitTestAdapter.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll</HintPath>
55+
<Private>False</Private>
56+
</Reference>
3857
<Reference Include="System" />
3958
<Reference Include="System.XML" />
4059
</ItemGroup>
@@ -44,16 +63,15 @@
4463
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
4564
</ItemGroup>
4665
</When>
47-
<Otherwise>
48-
<ItemGroup>
49-
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
50-
</ItemGroup>
51-
</Otherwise>
66+
<Otherwise />
5267
</Choose>
5368
<ItemGroup>
5469
<Compile Include="SnippetTests.cs" />
5570
<Compile Include="Properties\AssemblyInfo.cs" />
5671
</ItemGroup>
72+
<ItemGroup>
73+
<None Include="packages.config" />
74+
</ItemGroup>
5775
<Choose>
5876
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
5977
<ItemGroup>

Tests/packages.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="NUnit" version="2.6.4" targetFramework="net45" />
4+
<package id="NUnitTestAdapter" version="2.0.0" targetFramework="net45" />
5+
<package id="NUnit.Runners" version="2.6.4" />
6+
</packages>

jQueryCodeSnippets.sln

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2012
3+
# Visual Studio 2013
4+
VisualStudioVersion = 12.0.30723.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
46
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "jQueryCodeSnippets", "jQueryCodeSnippets\jQueryCodeSnippets.csproj", "{C1131DC7-264F-467E-90E2-ED2ED49BE43F}"
57
EndProject
68
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{90164978-E461-4BD8-8F21-15B199E7AFB1}"
79
EndProject
810
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ListingBuilder", "ListingBuilder\ListingBuilder.csproj", "{C5E392D6-D12C-4361-9E5C-5358DCCCB1C9}"
911
EndProject
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4E747CB5-56E9-4E50-BDD1-9C47A1A263D0}"
13+
ProjectSection(SolutionItems) = preProject
14+
.gitignore = .gitignore
15+
README.md = README.md
16+
travis.yml = travis.yml
17+
EndProjectSection
18+
EndProject
1019
Global
1120
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1221
Debug|Any CPU = Debug|Any CPU

travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: csharp
2+
solution: jQueryCodeSnippets.sln
3+
script:
4+
- xbuild /p:Configuration=Release jQueryCodeSnippets.sln
5+
- mono ./packages/NUnit.Runners.*/tools/nunit-console.exe ./Tests/bin/Release/Tests.dll

0 commit comments

Comments
 (0)