Skip to content

Commit d5d8808

Browse files
committed
QUnit (javascript testing framework)
1 parent 756f442 commit d5d8808

File tree

12 files changed

+13238
-64
lines changed

12 files changed

+13238
-64
lines changed
Lines changed: 237 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
/*!
2+
* QUnit 1.14.0
3+
* http://qunitjs.com/
4+
*
5+
* Copyright 2013 jQuery Foundation and other contributors
6+
* Released under the MIT license
7+
* http://jquery.org/license
8+
*
9+
* Date: 2014-01-31T16:40Z
10+
*/
11+
12+
/** Font Family and Sizes */
13+
14+
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
15+
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
16+
}
17+
18+
#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
19+
#qunit-tests { font-size: smaller; }
20+
21+
22+
/** Resets */
23+
24+
#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
25+
margin: 0;
26+
padding: 0;
27+
}
28+
29+
30+
/** Header */
31+
32+
#qunit-header {
33+
padding: 0.5em 0 0.5em 1em;
34+
35+
color: #8699A4;
36+
background-color: #0D3349;
37+
38+
font-size: 1.5em;
39+
line-height: 1em;
40+
font-weight: 400;
41+
42+
border-radius: 5px 5px 0 0;
43+
}
44+
45+
#qunit-header a {
46+
text-decoration: none;
47+
color: #C2CCD1;
48+
}
49+
50+
#qunit-header a:hover,
51+
#qunit-header a:focus {
52+
color: #FFF;
53+
}
54+
55+
#qunit-testrunner-toolbar label {
56+
display: inline-block;
57+
padding: 0 0.5em 0 0.1em;
58+
}
59+
60+
#qunit-banner {
61+
height: 5px;
62+
}
63+
64+
#qunit-testrunner-toolbar {
65+
padding: 0.5em 0 0.5em 2em;
66+
color: #5E740B;
67+
background-color: #EEE;
68+
overflow: hidden;
69+
}
70+
71+
#qunit-userAgent {
72+
padding: 0.5em 0 0.5em 2.5em;
73+
background-color: #2B81AF;
74+
color: #FFF;
75+
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
76+
}
77+
78+
#qunit-modulefilter-container {
79+
float: right;
80+
}
81+
82+
/** Tests: Pass/Fail */
83+
84+
#qunit-tests {
85+
list-style-position: inside;
86+
}
87+
88+
#qunit-tests li {
89+
padding: 0.4em 0.5em 0.4em 2.5em;
90+
border-bottom: 1px solid #FFF;
91+
list-style-position: inside;
92+
}
93+
94+
#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
95+
display: none;
96+
}
97+
98+
#qunit-tests li strong {
99+
cursor: pointer;
100+
}
101+
102+
#qunit-tests li a {
103+
padding: 0.5em;
104+
color: #C2CCD1;
105+
text-decoration: none;
106+
}
107+
#qunit-tests li a:hover,
108+
#qunit-tests li a:focus {
109+
color: #000;
110+
}
111+
112+
#qunit-tests li .runtime {
113+
float: right;
114+
font-size: smaller;
115+
}
116+
117+
.qunit-assert-list {
118+
margin-top: 0.5em;
119+
padding: 0.5em;
120+
121+
background-color: #FFF;
122+
123+
border-radius: 5px;
124+
}
125+
126+
.qunit-collapsed {
127+
display: none;
128+
}
129+
130+
#qunit-tests table {
131+
border-collapse: collapse;
132+
margin-top: 0.2em;
133+
}
134+
135+
#qunit-tests th {
136+
text-align: right;
137+
vertical-align: top;
138+
padding: 0 0.5em 0 0;
139+
}
140+
141+
#qunit-tests td {
142+
vertical-align: top;
143+
}
144+
145+
#qunit-tests pre {
146+
margin: 0;
147+
white-space: pre-wrap;
148+
word-wrap: break-word;
149+
}
150+
151+
#qunit-tests del {
152+
background-color: #E0F2BE;
153+
color: #374E0C;
154+
text-decoration: none;
155+
}
156+
157+
#qunit-tests ins {
158+
background-color: #FFCACA;
159+
color: #500;
160+
text-decoration: none;
161+
}
162+
163+
/*** Test Counts */
164+
165+
#qunit-tests b.counts { color: #000; }
166+
#qunit-tests b.passed { color: #5E740B; }
167+
#qunit-tests b.failed { color: #710909; }
168+
169+
#qunit-tests li li {
170+
padding: 5px;
171+
background-color: #FFF;
172+
border-bottom: none;
173+
list-style-position: inside;
174+
}
175+
176+
/*** Passing Styles */
177+
178+
#qunit-tests li li.pass {
179+
color: #3C510C;
180+
background-color: #FFF;
181+
border-left: 10px solid #C6E746;
182+
}
183+
184+
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
185+
#qunit-tests .pass .test-name { color: #366097; }
186+
187+
#qunit-tests .pass .test-actual,
188+
#qunit-tests .pass .test-expected { color: #999; }
189+
190+
#qunit-banner.qunit-pass { background-color: #C6E746; }
191+
192+
/*** Failing Styles */
193+
194+
#qunit-tests li li.fail {
195+
color: #710909;
196+
background-color: #FFF;
197+
border-left: 10px solid #EE5757;
198+
white-space: pre;
199+
}
200+
201+
#qunit-tests > li:last-child {
202+
border-radius: 0 0 5px 5px;
203+
}
204+
205+
#qunit-tests .fail { color: #000; background-color: #EE5757; }
206+
#qunit-tests .fail .test-name,
207+
#qunit-tests .fail .module-name { color: #000; }
208+
209+
#qunit-tests .fail .test-actual { color: #EE5757; }
210+
#qunit-tests .fail .test-expected { color: #008000; }
211+
212+
#qunit-banner.qunit-fail { background-color: #EE5757; }
213+
214+
215+
/** Result */
216+
217+
#qunit-testresult {
218+
padding: 0.5em 0.5em 0.5em 2.5em;
219+
220+
color: #2B81AF;
221+
background-color: #D2E0E6;
222+
223+
border-bottom: 1px solid #FFF;
224+
}
225+
#qunit-testresult .module-name {
226+
font-weight: 700;
227+
}
228+
229+
/** Fixture */
230+
231+
#qunit-fixture {
232+
position: absolute;
233+
top: -10000px;
234+
left: -10000px;
235+
width: 1000px;
236+
height: 1000px;
237+
}

Mvc.JQuery.Datatables.Example/Controllers/HomeController.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ public ActionResult Index()
1616
return View();
1717
}
1818

19+
public ActionResult JSUnitTests()
20+
{
21+
return View();
22+
}
1923

2024
public DataTablesResult<UserView> GetUsers(DataTablesParam dataTableParam)
2125
{
@@ -53,7 +57,7 @@ public DataTablesResult<UserView> GetUsers(DataTablesParam dataTableParam)
5357
public class UserView
5458
{
5559

56-
[DataTables(DisplayName = "Name", DisplayNameResourceType = typeof(UserViewResource), MRenderFunction = "test")]
60+
[DataTables(DisplayName = "Name", DisplayNameResourceType = typeof(UserViewResource), MRenderFunction = "encloseInEmTag")]
5761
public string Name { get; set; }
5862

5963
[DataTables(SortDirection = SortDirection.Ascending, Order = 0)]

Mvc.JQuery.Datatables.Example/Mvc.JQuery.Datatables.Example.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
<Content Include="Content\images\glyphicons-halflings-white.png" />
104104
<Content Include="Content\images\glyphicons-halflings.png" />
105105
<Content Include="Content\jquery.dataTables.lang.de-DE.txt" />
106+
<Content Include="Content\qunit-1.14.0.css" />
106107
<Content Include="Content\themes\Aristo\images\bg_fallback.png" />
107108
<Content Include="Content\themes\Aristo\images\icon_sprite.png" />
108109
<Content Include="Content\themes\Aristo\images\progress_bar.gif" />
@@ -179,12 +180,15 @@
179180
<Content Include="README.jQuery.vsdoc.txt" />
180181
<Content Include="Scripts\bootstrap.js" />
181182
<Content Include="Scripts\bootstrap.min.js" />
183+
<Content Include="Scripts\jquery-1.11.0.js" />
184+
<Content Include="Scripts\jquery-1.11.0.min.js" />
182185
<Content Include="Scripts\jquery-1.4.4-vsdoc.js" />
183186
<Content Include="Scripts\jquery-1.4.4.js" />
184187
<Content Include="Scripts\jquery-1.4.4.min.js" />
185188
<Content Include="Scripts\jquery-1.5.1-vsdoc.js" />
186189
<Content Include="Scripts\jquery-1.5.1.js" />
187190
<Content Include="Scripts\jquery-1.5.1.min.js" />
191+
<Content Include="Scripts\jquery-1.11.0.min.map" />
188192
<None Include="Scripts\jquery-1.6.4-vsdoc.js" />
189193
<Content Include="Scripts\jquery-1.6.4.js" />
190194
<Content Include="Scripts\jquery-1.6.4.min.js" />
@@ -556,6 +560,8 @@
556560
<Content Include="Scripts\modernizr-1.7.js" />
557561
<Content Include="Scripts\modernizr-1.7.min.js" />
558562
<Content Include="Scripts\modernizr-2.0.6-development-only.js" />
563+
<Content Include="Scripts\qunit-1.14.0.js" />
564+
<Content Include="Scripts\QUnitTests.js" />
559565
<Content Include="Web.config" />
560566
<Content Include="Web.Debug.config">
561567
<DependentUpon>Web.config</DependentUpon>
@@ -573,6 +579,8 @@
573579
<Content Include="Scripts\MicrosoftMvcAjax.debug.js" />
574580
<Content Include="Scripts\MicrosoftMvcValidation.js" />
575581
<Content Include="Scripts\MicrosoftMvcValidation.debug.js" />
582+
<Content Include="Views\Home\JSUnitTests.cshtml" />
583+
<Content Include="Views\Home\_ExampleTable.cshtml" />
576584
</ItemGroup>
577585
<ItemGroup>
578586
<Folder Include="Models\" />

0 commit comments

Comments
 (0)