Sha256: 14625c8490e975cc7192014b99c37918ff3ca5150535f3603e0fdfd568383be9

Contents?: true

Size: 1.55 KB

Versions: 240

Compression:

Stored size: 1.55 KB

Contents

module ETLTest

open NUnit.Framework
open ETL

[<Test>]
let ``Transforms one value`` () =
    let old = [(1, ["A"])] |> Map.ofSeq
    let expected = [("a", 1)] |> Map.ofSeq
    Assert.That(transform old, Is.EqualTo(expected))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Transforms multiple values`` () =
    let old = [(1, ["A"; "E"; "I"; "O"; "U"])] |> Map.ofSeq
    let expected = [("a", 1); ("e", 1); ("i", 1); ("o", 1); ("u", 1)] |> Map.ofSeq
    Assert.That(transform old, Is.EqualTo(expected))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Transforms multiple keys`` () =
    let old = [(1, ["A"; "E"]); (2, ["D"; "G"])] |> Map.ofSeq
    let expected = [("a", 1); ("e", 1); ("d", 2); ("g", 2); ] |> Map.ofSeq
    Assert.That(transform old, Is.EqualTo(expected))

[<Test>]
[<Ignore("Remove to run test")>]
let ``Transforms a full dataset`` () =
    let old = [(1, ["A"; "E"; "I"; "O"; "U"; "L"; "N"; "R"; "S"; "T"]); 
                (2, ["D"; "G"]); 
                (3, ["B"; "C"; "M"; "P"]); 
                (4, ["F"; "H"; "V"; "W"; "Y"]); 
                (5, ["K"]); 
                (8, ["J"; "X"]); 
                (10, ["Q"; "Z"])] |> Map.ofSeq

    let expected = [("a", 1);  ("b", 3);  ("c", 3);  ("d", 2);  ("e", 1);  ("f", 4);  ("g", 2);  ("h", 4);  ("i", 1); 
                    ("j", 8);  ("k", 5);  ("l", 1);  ("m", 3);  ("n", 1);  ("o", 1);  ("p", 3);  ("q", 10);  ("r", 1); 
                    ("s", 1);  ("t", 1);  ("u", 1);  ("v", 4);  ("w", 4);  ("x", 8);  ("y", 4);  ("z", 10 )] |> Map.ofSeq

    Assert.That(transform old, Is.EqualTo(expected))

Version data entries

240 entries across 240 versions & 1 rubygems

Version Path
trackler-2.1.0.4 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.1.0.3 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.1.0.2 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.1.0.1 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.1.0.0 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.55 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.54 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.53 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.52 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.51 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.50 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.49 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.48 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.47 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.46 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.45 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.44 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.43 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.42 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.0.8.41 tracks/fsharp/exercises/etl/ETLTest.fs