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.2.1.22 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.21 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.20 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.19 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.18 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.17 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.16 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.15 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.14 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.13 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.12 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.11 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.10 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.9 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.8 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.7 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.6 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.5 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.4 tracks/fsharp/exercises/etl/ETLTest.fs
trackler-2.2.1.3 tracks/fsharp/exercises/etl/ETLTest.fs