Repository navigation
Expand file tree
/
Copy pathdictionary-checker.spec.js
More file actions
54 lines (44 loc) · 1.71 KB
/
Copy pathdictionary-checker.spec.js
File metadata and controls
54 lines (44 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"use strict";
let assert = require("assert");
let DictionaryChecker = require("./dictionary-checker.js");
let DictionaryRules = require("./dictionary-rules.json");
describe("dictionaryChecker", function() {
describe("isWord", function() {
it("A", function() {
var dictionaryChecker = new DictionaryChecker();
assert.equal(true, dictionaryChecker.isWord(DictionaryRules, "A"));
});
it("AB", function() {
var dictionaryChecker = new DictionaryChecker();
assert.equal(false, dictionaryChecker.isWord(DictionaryRules, "AB"));
});
it("B", function() {
var dictionaryChecker = new DictionaryChecker();
assert.equal(false, dictionaryChecker.isWord(DictionaryRules, "B"));
});
it("BA", function() {
var dictionaryChecker = new DictionaryChecker();
assert.equal(false, dictionaryChecker.isWord(DictionaryRules, "BA"));
});
it("BI", function() {
var dictionaryChecker = new DictionaryChecker();
assert.equal(false, dictionaryChecker.isWord(DictionaryRules, "BI"));
});
it("BAR", function() {
var dictionaryChecker = new DictionaryChecker();
assert.equal(true, dictionaryChecker.isWord(DictionaryRules, "BAR"));
});
it("BARK", function() {
var dictionaryChecker = new DictionaryChecker();
assert.equal(true, dictionaryChecker.isWord(DictionaryRules, "BARK"));
});
it("BART", function() {
var dictionaryChecker = new DictionaryChecker();
assert.equal(false, dictionaryChecker.isWord(DictionaryRules, "BART"));
});
it("CAT", function() {
var dictionaryChecker = new DictionaryChecker();
assert.equal(false, dictionaryChecker.isWord(DictionaryRules, "CAT"));
});
});
});