Browse Source

add testing packages and wire them into Test Centre.

Rename name spaces in CLI and test folder for saving image test.
master
Craig Oates 6 years ago
parent
commit
bb63869029
  1. 2
      DeathSocketCLI/Commands.fs
  2. 2
      DeathSocketCLI/Validation.fs
  3. 27
      TestCentre/ConsoleTests.fs
  4. 4
      TestCentre/Library1.fs
  5. 34
      TestCentre/TestCentre.fsproj
  6. 12
      TestCentre/packages.config

2
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

2
DeathSocketCLI/Validation.fs

@ -1,4 +1,4 @@
module Validation
module DeathSocket.Validation
open DeathSocket
open System.Drawing

27
TestCentre/ConsoleTests.fs

@ -0,0 +1,27 @@
namespace ConsoleTests
module PropertyTests =
open System
open FsCheck.Xunit
open DeathSocket.Validation
[<Property>]
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/"
[<Fact>]
let ``Saving Test Area can be located`` () =
Assert.True (Directory.Exists saveLocation)
[<Fact>]
let ``Colour list is not empty`` () =
Assert.False (colourList.IsEmpty)

4
TestCentre/Library1.fs

@ -1,4 +0,0 @@
namespace TestCentre
type Class1() =
member this.X = "F#"

34
TestCentre/TestCentre.fsproj

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\xunit.core.2.4.0\build\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.4.0\build\xunit.core.props')" />
<Import Project="..\packages\xunit.runner.visualstudio.2.4.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.4.0\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@ -13,6 +15,8 @@
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Name>TestCentre</Name>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -42,21 +46,40 @@
<Import Project="$(FSharpTargetsPath)" />
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Library1.fs" />
<Compile Include="ConsoleTests.fs" />
<None Include="Script.fsx" />
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="FsCheck">
<HintPath>..\packages\FsCheck.2.11.0\lib\net452\FsCheck.dll</HintPath>
</Reference>
<Reference Include="FsCheck.Xunit">
<HintPath>..\packages\FsCheck.Xunit.2.11.0\lib\net452\FsCheck.Xunit.dll</HintPath>
</Reference>
<Reference Include="FSharp.Core">
<HintPath>..\packages\FSharp.Core.4.5.2\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Numerics" />
<Reference Include="System.ValueTuple">
<Private>True</Private>
</Reference>
<Reference Include="xunit.abstractions">
<HintPath>..\packages\xunit.abstractions.2.0.3\lib\net35\xunit.abstractions.dll</HintPath>
</Reference>
<Reference Include="xunit.assert">
<HintPath>..\packages\xunit.assert.2.4.0\lib\netstandard2.0\xunit.assert.dll</HintPath>
</Reference>
<Reference Include="xunit.core">
<HintPath>..\packages\xunit.extensibility.core.2.4.0\lib\net452\xunit.core.dll</HintPath>
</Reference>
<Reference Include="xunit.execution.desktop">
<HintPath>..\packages\xunit.extensibility.execution.2.4.0\lib\net452\xunit.execution.desktop.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DeathSocketCLI\DeathSocketCLI.fsproj">
@ -70,6 +93,15 @@
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>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}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.4.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.4.0\build\net20\xunit.runner.visualstudio.props'))" />
<Error Condition="!Exists('..\packages\xunit.core.2.4.0\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.4.0\build\xunit.core.props'))" />
<Error Condition="!Exists('..\packages\xunit.core.2.4.0\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.4.0\build\xunit.core.targets'))" />
</Target>
<Import Project="..\packages\xunit.core.2.4.0\build\xunit.core.targets" Condition="Exists('..\packages\xunit.core.2.4.0\build\xunit.core.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">

12
TestCentre/packages.config

@ -1,5 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FsCheck" version="2.11.0" targetFramework="net471" />
<package id="FsCheck.Xunit" version="2.11.0" targetFramework="net471" />
<package id="FSharp.Core" version="4.5.2" targetFramework="net471" />
<package id="System.ValueTuple" version="4.4.0" targetFramework="net471" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net471" />
<package id="xunit" version="2.4.0" targetFramework="net471" />
<package id="xunit.abstractions" version="2.0.3" targetFramework="net471" />
<package id="xunit.analyzers" version="0.10.0" targetFramework="net471" />
<package id="xunit.assert" version="2.4.0" targetFramework="net471" />
<package id="xunit.core" version="2.4.0" targetFramework="net471" />
<package id="xunit.extensibility.core" version="2.4.0" targetFramework="net471" />
<package id="xunit.extensibility.execution" version="2.4.0" targetFramework="net471" />
<package id="xunit.runner.visualstudio" version="2.4.0" targetFramework="net471" developmentDependency="true" />
</packages>
Loading…
Cancel
Save