mirror of
https://github.com/Smaug123/dotnet-classical-ciphers
synced 2025-10-14 00:48:40 +00:00
Initial commit
This commit is contained in:
23
CipherSuite.Test/TestCaesar.fs
Normal file
23
CipherSuite.Test/TestCaesar.fs
Normal file
@@ -0,0 +1,23 @@
|
||||
namespace CipherSuite.Test
|
||||
|
||||
open NUnit.Framework
|
||||
open CipherSuite
|
||||
open FsUnitTyped
|
||||
|
||||
[<TestFixture>]
|
||||
module TestCaesar =
|
||||
|
||||
[<Test>]
|
||||
let ``Examples, Challenge 1`` () =
|
||||
let key, plain, fitness = Caesar.crack Examples.challenge1A
|
||||
|
||||
plain.StartsWith "I WAS HOPING I WOULD FIND YOU HERE" |> shouldEqual true
|
||||
|
||||
printfn "%f" fitness
|
||||
key |> shouldEqual 6
|
||||
|
||||
let key, plain, fitness = Caesar.crack Examples.challenge1B
|
||||
|
||||
plain.StartsWith "DEAR MS FRANK," |> shouldEqual true
|
||||
|
||||
key |> shouldEqual 18
|
Reference in New Issue
Block a user