From bb63869029102d19edb3b64f0c08a3b8ecfde2e1 Mon Sep 17 00:00:00 2001 From: "OPTIMUS-PRIME\\craig" Date: Fri, 14 Sep 2018 18:44:37 +0100 Subject: [PATCH] add testing packages and wire them into Test Centre. Rename name spaces in CLI and test folder for saving image test. --- DeathSocketCLI/Commands.fs | 2 +- DeathSocketCLI/Validation.fs | 2 +- TestCentre/ConsoleTests.fs | 27 +++++++++++++++++++++++++++ TestCentre/Library1.fs | 4 ---- TestCentre/TestCentre.fsproj | 34 +++++++++++++++++++++++++++++++++- TestCentre/packages.config | 12 +++++++++++- 6 files changed, 73 insertions(+), 8 deletions(-) create mode 100644 TestCentre/ConsoleTests.fs delete mode 100644 TestCentre/Library1.fs diff --git a/DeathSocketCLI/Commands.fs b/DeathSocketCLI/Commands.fs index ac782e1..c95d3c5 100644 --- a/DeathSocketCLI/Commands.fs +++ b/DeathSocketCLI/Commands.fs @@ -3,7 +3,7 @@ module ConsoleCommands = open System open DeathSocket.GridPainter - open Validation + open DeathSocket.Validation open System.IO open Console.Waterworks open Console.Waterworks.Attributes diff --git a/DeathSocketCLI/Validation.fs b/DeathSocketCLI/Validation.fs index d922e05..de3f5cb 100644 --- a/DeathSocketCLI/Validation.fs +++ b/DeathSocketCLI/Validation.fs @@ -1,4 +1,4 @@ -module Validation +module DeathSocket.Validation open DeathSocket open System.Drawing diff --git a/TestCentre/ConsoleTests.fs b/TestCentre/ConsoleTests.fs new file mode 100644 index 0000000..9ba4a8d --- /dev/null +++ b/TestCentre/ConsoleTests.fs @@ -0,0 +1,27 @@ +namespace ConsoleTests + + module PropertyTests = + + open System + open FsCheck.Xunit + open DeathSocket.Validation + + [] + let ``Setting pen width greater than 0`` () = + (setPenWidth (Random().Next()) (Random().Next())) > 0.0f + + module UnitTests = + + open Xunit + open DeathSocket.Validation + open System.IO + + let saveLocation = __SOURCE_DIRECTORY__ + "/SavingTestArea/" + + [] + let ``Saving Test Area can be located`` () = + Assert.True (Directory.Exists saveLocation) + + [] + let ``Colour list is not empty`` () = + Assert.False (colourList.IsEmpty) \ No newline at end of file diff --git a/TestCentre/Library1.fs b/TestCentre/Library1.fs deleted file mode 100644 index 7809afa..0000000 --- a/TestCentre/Library1.fs +++ /dev/null @@ -1,4 +0,0 @@ -namespace TestCentre - -type Class1() = - member this.X = "F#" diff --git a/TestCentre/TestCentre.fsproj b/TestCentre/TestCentre.fsproj index ba01899..b2621f2 100644 --- a/TestCentre/TestCentre.fsproj +++ b/TestCentre/TestCentre.fsproj @@ -1,5 +1,7 @@ + + Debug @@ -13,6 +15,8 @@ v4.7.1 true TestCentre + + true @@ -42,21 +46,40 @@ - + + + ..\packages\FsCheck.2.11.0\lib\net452\FsCheck.dll + + + ..\packages\FsCheck.Xunit.2.11.0\lib\net452\FsCheck.Xunit.dll + ..\packages\FSharp.Core.4.5.2\lib\net45\FSharp.Core.dll + True + + ..\packages\xunit.abstractions.2.0.3\lib\net35\xunit.abstractions.dll + + + ..\packages\xunit.assert.2.4.0\lib\netstandard2.0\xunit.assert.dll + + + ..\packages\xunit.extensibility.core.2.4.0\lib\net452\xunit.core.dll + + + ..\packages\xunit.extensibility.execution.2.4.0\lib\net452\xunit.execution.desktop.dll + @@ -70,6 +93,15 @@ True + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + +