commit
message
[Serializer] adding tests
author
Ben Vogt <[email protected]>
date
2017-05-12 22:48:04
stats
2 file(s) changed,
17 insertions(+),
3 deletions(-)
files
README.md
tests/Utilities/SerializerTest.ts
1diff --git a/README.md b/README.md
2index d0154ff..8e781ca 100644
3--- a/README.md
4+++ b/README.md
5@@ -73,9 +73,6 @@ TypeConverter.
6 ### Test CriteriaFunctionFactory
7
8
9-### Test Serilaizer
10-
11-
12 ### Test TypeConverter
13
14
15diff --git a/tests/Utilities/SerializerTest.ts b/tests/Utilities/SerializerTest.ts
16new file mode 100644
17index 0000000..dbd93d2
18--- /dev/null
19+++ b/tests/Utilities/SerializerTest.ts
20@@ -0,0 +1,17 @@
21+import {
22+ assertEquals,
23+ test
24+} from "../Utils/Asserts";
25+import {
26+ Serializer
27+} from "../../src/Utilities/Serializer";
28+
29+test("Serializer.serialize", function () {
30+ assertEquals(Serializer.serialize(22), "<number: 22>");
31+ assertEquals(Serializer.serialize(0), "<number: 0>");
32+ assertEquals(Serializer.serialize(87342794), "<number: 87342794>");
33+ assertEquals(Serializer.serialize("87342794"), "<string: 87342794>");
34+ assertEquals(Serializer.serialize("hello"), "<string: hello>");
35+ assertEquals(Serializer.serialize(false), "<boolean: false>");
36+ assertEquals(Serializer.serialize(true), "<boolean: true>");
37+});