Skip to content

Commit e37de1f

Browse files
committed
tests decoration
1 parent fa957e0 commit e37de1f

24 files changed

+245
-33
lines changed

test/typescript/dictionary.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
module MxTests {
22

3+
import Dictionary = mx.Dictionary;
4+
import KeyValuePair = mx.KeyValuePair;
5+
import EqualityComparer = mx.EqualityComparer;
6+
7+
8+
9+
/* Factory methods
10+
---------------------------------------------------------------------- */
311

412
function CreateDictionary(): Dictionary<number, string> {
513
var dic = new Dictionary<number, string>();
@@ -11,7 +19,11 @@
1119

1220
return dic;
1321
}
22+
23+
1424

25+
/* Tests
26+
---------------------------------------------------------------------- */
1527

1628
QUnit.module("Dictionary");
1729

@@ -175,6 +187,6 @@
175187

176188
assert.deepEqual(_dic.select(t => t.key).toArray(), [1, 2, 3, 4, 5], "dictionary select keys, to array!");
177189
assert.deepEqual(_dic.select(t => t.value).toArray(), ["A", "B", "C", "D", "E"], "dictionary select values, to array!");
178-
assert.ok(_dic.toArray().first().key === 1 && _dic.toArray().first().value === "A", "dictionary select key-value items!");
190+
assert.ok(_dic.toArray()[0].key === 1 && _dic.toArray()[0].value === "A", "dictionary select key-value items!");
179191
});
180192
}

test/typescript/hashset.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
module MxTests {
22

3+
import HashSet = mx.HashSet;
4+
import EqualityComparer = mx.EqualityComparer;
5+
6+
7+
8+
/* Factory methods
9+
---------------------------------------------------------------------- */
10+
311
interface SimpleObject {
412
name: string;
513
val: number;
@@ -20,6 +28,10 @@
2028
}
2129

2230

31+
32+
/* Tests
33+
---------------------------------------------------------------------- */
34+
2335
QUnit.module("Hashset");
2436

2537

test/typescript/linkedlist.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
module MxTests {
22

3+
import LinkedListNode = mx.LinkedListNode;
4+
import LinkedList = mx.LinkedList;
5+
6+
7+
8+
/* Factory methods
9+
---------------------------------------------------------------------- */
310

411
function CreateLinkedList(): LinkedList<number> {
512
return new LinkedList(mx.range(1, 5));
613
}
14+
15+
716

17+
/* Tests
18+
---------------------------------------------------------------------- */
819

920
QUnit.module("LinkedList");
1021

test/typescript/linq.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
module MxTests {
22

33

4+
/* Classes
5+
---------------------------------------------------------------------- */
6+
47
// class without equality-comparer
58
class SimpleClass {
69
};
@@ -27,7 +30,9 @@
2730
};
2831

2932

30-
// factory methods
33+
34+
/* Factory methods
35+
---------------------------------------------------------------------- */
3136

3237
var _time = new Date().getTime();
3338

@@ -84,6 +89,9 @@
8489

8590

8691

92+
/* Tests
93+
---------------------------------------------------------------------- */
94+
8795
QUnit.module("Linq");
8896

8997

test/typescript/list.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
module MxTests {
2+
3+
import List = mx.List;
24

35

46

7+
/* Factory methods
8+
---------------------------------------------------------------------- */
9+
510
function CreateList(): List<number> {
611
return new List(1, 2, 3, 4, 5);
712
}
813

914

15+
16+
/* Tests
17+
---------------------------------------------------------------------- */
18+
1019
QUnit.module("List");
1120

1221

test/typescript/lookup.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
module MxTests {
22

33

4+
/* Factory methods
5+
---------------------------------------------------------------------- */
6+
47
function CreateLookup(): mx.Lookup<number, number> {
58
return mx([1, 1, 2, 3, 3, 4, 4, 4]).toLookup(t => t);
69
}
710

811

12+
13+
/* Tests
14+
---------------------------------------------------------------------- */
15+
916
QUnit.module("Lookup");
1017

1118

test/typescript/mx.ts

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
module MxTests {
22

3+
import Enumerator = mx.Enumerator;
4+
import Enumerable = mx.Enumerable;
35

4-
/**
5-
* Returns the number of elements in a sequence.
6-
* @param {Enumerable} source An enumerable object.
7-
* @returns {Number}
8-
*/
9-
function MxCount(source: IEnumerable<any>): number {
6+
7+
8+
/* Factory methods
9+
---------------------------------------------------------------------- */
10+
11+
function MxCount(source: Enumerable<any>): number {
1012
var _e = source.getEnumerator(),
1113
_i = 0;
1214

@@ -18,6 +20,10 @@
1820
}
1921

2022

23+
24+
/* Tests
25+
---------------------------------------------------------------------- */
26+
2127
QUnit.module("Multiplex");
2228

2329

@@ -46,20 +52,20 @@
4652
});
4753

4854

49-
QUnit.test("Multiplex Iterable", function (assert) {
50-
var _set = new Set(),
51-
_source = mx(_set);
52-
53-
_set.add(1);
54-
_set.add(2);
55-
_set.add(3);
56-
assert.ok(MxCount(_source) === 3, "Passed!");
57-
});
55+
//QUnit.test("Multiplex Iterable", function (assert) {
56+
// var _set = new Set(),
57+
// _source = mx(_set);
58+
59+
// _set.add(1);
60+
// _set.add(2);
61+
// _set.add(3);
62+
// assert.ok(MxCount(_source) === 3, "Passed!");
63+
//});
5864

5965

6066
QUnit.test("Multiplex Custom Enumerator", function (assert) {
6167
var _source = mx({
62-
getEnumerator: function (): IEnumerator<number> {
68+
getEnumerator: function (): Enumerator<number> {
6369
var count = 3, index = 0;
6470
return {
6571
current: undefined,
@@ -126,10 +132,10 @@
126132
assert.ok(mx.is(mx.range(1, 10)), "Enumerable Passed!");
127133
assert.ok(mx.is([1]), "Array Passed!");
128134
assert.ok(mx.is("mx"), "String Passed!");
129-
assert.ok(mx.is(new Set()), "Iterable Passed!");
135+
//assert.ok(mx.is(new Set()), "Iterable Passed!");
130136

131137
assert.ok(mx.is({
132-
getEnumerator: function (): IEnumerator<number> {
138+
getEnumerator: function (): Enumerator<number> {
133139
var count = 3, index = 0;
134140
return {
135141
current: undefined,

test/typescript/queue.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
module MxTests {
22

3+
import Queue = mx.Queue;
4+
5+
6+
7+
/* Factory methods
8+
---------------------------------------------------------------------- */
9+
310
function CreateQueue(): Queue<number> {
411
return new Queue(mx.range(1, 5));
512
}
613

714

15+
16+
/* Tests
17+
---------------------------------------------------------------------- */
18+
819
QUnit.module("Queue");
920

1021

test/typescript/readonlycollection.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
module MxTests {
22

3+
import List = mx.List;
4+
import ReadOnlyCollection = mx.ReadOnlyCollection;
5+
6+
7+
8+
/* Factory methods
9+
---------------------------------------------------------------------- */
310

411
function CreateCollection(): ReadOnlyCollection<number> {
512
return new ReadOnlyCollection(new List<number>(1, 2, 3, 4, 5));
613
}
714

815

16+
17+
/* Tests
18+
---------------------------------------------------------------------- */
19+
920
QUnit.module("ReadOnlyCollection");
1021

1122

test/typescript/runtime.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
module MxTests {
22

3+
import EqualityComparer = mx.EqualityComparer;
4+
5+
6+
7+
/* Classes
8+
---------------------------------------------------------------------- */
9+
310
// class without equality-comparer
411
class SimpleClass {
512
};
@@ -27,6 +34,8 @@
2734

2835

2936

37+
/* Tests
38+
---------------------------------------------------------------------- */
3039

3140
QUnit.module("Runtime");
3241

0 commit comments

Comments
 (0)