-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAsciiTests.fs
45 lines (31 loc) · 1.24 KB
/
AsciiTests.fs
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
module AsciiTests
open NUnit.Framework
open FsUnit
open Ascii
[<Test>]
let ``Ascii to bytes to ascii should be equal``() =
let original = "Bla bla"
let bytes = asciiToBytes original
let ascii = bytesToAscii bytes
ascii |> should equal original
[<Test>]
let ``Char scorer``() =
let goodText = "This is the text that will be xor encrypted!!!!!!!"
let badText = "nSSHRINS_N^BOORZNMRVWY_BTH_UYICKN^^nSSHRINS_N^BOOR"
let badScore = charScorer badText
let goodScore = charScorer goodText
goodScore |> should greaterThan badScore
[<Test>]
let ``Char scorer english``() =
let goodText = "This is the text that will be xor encrypted!!!!!!!"
let equalText = "Uhir ir tie uexu tiat!wiml ce yor!enbryqtee!! !! !"
let goodScore = charScorer goodText
let equalScore = charScorer equalText
goodScore |> should equal equalScore
[<Test>]
let ``Text scorer english``() =
let goodText = "This is the text that will be xor encrypted!!!!!!!"
let badText = "Uhir ir tie uexu tiat!wiml ce yor!enbryqtee!! !! !"
let goodScore = textScorer goodText
let badScore = textScorer badText
goodScore |> should greaterThan badScore