Browse Source

add unit tests for skia based validation functions in CLI.

master
Craig Oates 5 years ago
parent
commit
cc2fdc0410
  1. 2
      DeathSocketCLI/Validation.fs
  2. 11
      TestCentre/ConsoleTests.fs
  3. 5
      TestCentre/TestCentre.fsproj
  4. 1
      TestCentre/packages.config

2
DeathSocketCLI/Validation.fs

@ -79,7 +79,7 @@
"red", SKColors.Red
"white", SKColors.White
"yellow", SKColors.Yellow ]
|> Map.ofList
|> Map.ofList
let isSkiaColourValid (colour: string) =
skiaColourList

11
TestCentre/ConsoleTests.fs

@ -110,4 +110,13 @@
[<Fact>]
let ``Exception thrown when invalid colour is used`` () =
Assert.Throws<System.ArgumentException>
(fun () -> parseColour "not a valid colour" |> ignore)
(fun () -> parseColour "not a valid colour" |> ignore)
[<Fact>]
let ``Skia colour list is not empty`` () =
Assert.False (skiaColourList.IsEmpty)
[<Fact>]
let ``Exception thrown when invalid skia-colour is used`` () =
Assert.Throws<System.ArgumentException>
(fun () -> parseSkiaColour "not a valid colour" |> ignore)

5
TestCentre/TestCentre.fsproj

@ -62,6 +62,9 @@
<HintPath>..\packages\FSharp.Core.4.5.4\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="SkiaSharp">
<HintPath>..\packages\SkiaSharp.1.60.3\lib\net45\SkiaSharp.dll</HintPath>
</Reference>
<Reference Include="SmoulderingBeachBall">
<HintPath>..\packages\SmoulderingBeachBall.0.4.0-alpha1\lib\netstandard2.0\SmoulderingBeachBall.dll</HintPath>
</Reference>
@ -107,8 +110,10 @@
<Error Condition="!Exists('..\packages\xunit.core.2.4.1\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.4.1\build\xunit.core.props'))" />
<Error Condition="!Exists('..\packages\xunit.core.2.4.1\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.4.1\build\xunit.core.targets'))" />
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.4.1\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.4.1\build\net20\xunit.runner.visualstudio.props'))" />
<Error Condition="!Exists('..\packages\SkiaSharp.1.60.3\build\net45\SkiaSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SkiaSharp.1.60.3\build\net45\SkiaSharp.targets'))" />
</Target>
<Import Project="..\packages\xunit.core.2.4.1\build\xunit.core.targets" Condition="Exists('..\packages\xunit.core.2.4.1\build\xunit.core.targets')" />
<Import Project="..\packages\SkiaSharp.1.60.3\build\net45\SkiaSharp.targets" Condition="Exists('..\packages\SkiaSharp.1.60.3\build\net45\SkiaSharp.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

1
TestCentre/packages.config

@ -3,6 +3,7 @@
<package id="FsCheck" version="2.13.0" targetFramework="net471" />
<package id="FsCheck.Xunit" version="2.13.0" targetFramework="net471" />
<package id="FSharp.Core" version="4.5.4" targetFramework="net471" />
<package id="SkiaSharp" version="1.60.3" targetFramework="net471" />
<package id="SmoulderingBeachBall" version="0.4.0-alpha1" targetFramework="net471" />
<package id="System.Drawing.Common" version="4.5.1" targetFramework="net471" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net471" />

Loading…
Cancel
Save