Sha256: e13a50b071fba03d4f990d70544091be13877ff68b3a0ef08e4bb60c6a41f36b

Contents?: true

Size: 1.35 KB

Versions: 240

Compression:

Stored size: 1.35 KB

Contents

module LargestSeriesProductTest

open NUnit.Framework
open LargestSeriesProduct
    
[<TestCase("01234567890", 2, ExpectedResult = 72)>]
[<TestCase("1027839564", 3, ExpectedResult = 270, Ignore = "Remove to run test case")>]
let ``Gets the largest product``(digits: string) (seriesLength: int) =
    largestProduct digits seriesLength
    
[<Test>]
[<Ignore("Remove to run test")>]
let ``Largest product works for small numbers`` () =
    Assert.That(largestProduct "19" 2, Is.EqualTo(9))
    
[<Test>]
[<Ignore("Remove to run test")>]
let ``Largest product works for large numbers`` () =
    let LARGE_NUMBER = "73167176531330624919225119674426574742355349194934"
    Assert.That(largestProduct LARGE_NUMBER 6, Is.EqualTo(23520))
    
[<TestCase("0000", 2, ExpectedResult = 0, Ignore = "Remove to run test case")>]
[<TestCase("99099", 3, ExpectedResult = 0, Ignore = "Remove to run test case")>]
let ``Largest product works if all spans contain zero``(digits: string) (seriesLength: int) =
    largestProduct digits seriesLength
    
[<TestCase("", ExpectedResult = 1)>]
[<TestCase("123", ExpectedResult = 1)>]
let ``Largest product for empty span is 1``(digits: string) =
    largestProduct digits 0
    
[<Test>]
[<Ignore("Remove to run test")>]
let ``Cannot slice empty string with nonzero span`` () =
    Assert.That((fun () -> largestProduct "" 1 |> ignore), Throws.Exception)

Version data entries

240 entries across 240 versions & 1 rubygems

Version Path
trackler-2.2.1.2 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.2.1.1 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.2.1.0 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.2.0.6 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.2.0.5 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.2.0.4 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.2.0.3 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.2.0.2 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.2.0.1 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.2.0.0 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.1.0.55 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.1.0.54 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.1.0.53 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.1.0.52 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.1.0.51 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.1.0.50 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.1.0.49 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.1.0.48 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.1.0.47 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs
trackler-2.1.0.46 tracks/fsharp/exercises/largest-series-product/LargestSeriesProductTest.fs