Browse Source

Got Xunit running.

Visual Studio runner, also, working.
master
Craig Oates 6 years ago
parent
commit
44d8c5e702
  1. 41
      TestCentre/AssemblyInfo.fs
  2. 6
      TestCentre/PropTests.fs
  3. 8
      TestCentre/Script.fsx
  4. 116
      TestCentre/TestCentre.fsproj
  5. 15
      TestCentre/UnitTests.fs
  6. 12
      TestCentre/packages.config
  7. 10
      WetPancake.sln

41
TestCentre/AssemblyInfo.fs

@ -0,0 +1,41 @@
namespace TestCentre.AssemblyInfo
open System.Reflection
open System.Runtime.CompilerServices
open System.Runtime.InteropServices
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[<assembly: AssemblyTitle("TestCentre")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("")>]
[<assembly: AssemblyProduct("TestCentre")>]
[<assembly: AssemblyCopyright("Copyright © 2018")>]
[<assembly: AssemblyTrademark("")>]
[<assembly: AssemblyCulture("")>]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[<assembly: ComVisible(false)>]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[<assembly: Guid("aa30074c-bef2-4f2b-89f4-7069179b3ab7")>]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [<assembly: AssemblyVersion("1.0.*")>]
[<assembly: AssemblyVersion("1.0.0.0")>]
[<assembly: AssemblyFileVersion("1.0.0.0")>]
do
()

6
TestCentre/PropTests.fs

@ -1,6 +0,0 @@
module PropTests
open FsCheck
open WetPancake.Pancake
let RandomText = RequestRandomText()

8
TestCentre/Script.fsx

@ -0,0 +1,8 @@
// Learn more about F# at http://fsharp.org
// See the 'F# Tutorial' project for more help.
#load "Library1.fs"
open TestCentre
// Define your library scripting code here

116
TestCentre/TestCentre.fsproj

@ -1,22 +1,112 @@
<Project Sdk="Microsoft.NET.Sdk">
<?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.runner.visualstudio.2.3.1\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.3.1\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="..\packages\xunit.core.2.3.1\build\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.3.1\build\xunit.core.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>aa30074c-bef2-4f2b-89f4-7069179b3ab7</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>TestCentre</RootNamespace>
<AssemblyName>TestCentre</AssemblyName>
<UseStandardResourceNames>true</UseStandardResourceNames>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
<TargetFSharpCoreVersion>4.4.3.0</TargetFSharpCoreVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Name>TestCentre</Name>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>bin\$(Configuration)\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\$(Configuration)\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
</PropertyGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '11.0'">
<PropertyGroup Condition=" '$(FSharpTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets') ">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup Condition=" '$(FSharpTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets') ">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
</Choose>
<Import Project="$(FSharpTargetsPath)" />
<ItemGroup>
<Compile Include="PropTests.fs" />
<Compile Include="AssemblyInfo.fs" />
<Compile Include="UnitTests.fs" />
<None Include="Script.fsx" />
<Content Include="packages.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FsCheck" Version="2.10.10" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<Reference Include="mscorlib" />
<Reference Include="FSharp.Core">
<Name>FSharp.Core</Name>
<AssemblyName>FSharp.Core.dll</AssemblyName>
<HintPath>$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\$(TargetFSharpCoreVersion)\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.ValueTuple">
<Private>True</Private>
</Reference>
<Reference Include="xunit.abstractions">
<HintPath>..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
</Reference>
<Reference Include="xunit.assert">
<HintPath>..\packages\xunit.assert.2.3.1\lib\netstandard1.1\xunit.assert.dll</HintPath>
</Reference>
<Reference Include="xunit.core">
<HintPath>..\packages\xunit.extensibility.core.2.3.1\lib\netstandard1.1\xunit.core.dll</HintPath>
</Reference>
<Reference Include="xunit.execution.desktop">
<HintPath>..\packages\xunit.extensibility.execution.2.3.1\lib\net452\xunit.execution.desktop.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WetPancake\WetPancake.fsproj" />
<ProjectReference Include="..\WetPancake\WetPancake.fsproj">
<Name>WetPancake</Name>
<Project>{cb878c2d-edba-490b-b6b3-01b57779a28f}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
</Project>
<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.core.2.3.1\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.3.1\build\xunit.core.props'))" />
<Error Condition="!Exists('..\packages\xunit.core.2.3.1\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.3.1\build\xunit.core.targets'))" />
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.3.1\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.3.1\build\net20\xunit.runner.visualstudio.props'))" />
</Target>
<Import Project="..\packages\xunit.core.2.3.1\build\xunit.core.targets" Condition="Exists('..\packages\xunit.core.2.3.1\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">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

15
TestCentre/UnitTests.fs

@ -1,10 +1,11 @@
namespace TestCentre.UnitTests
namespace TestCentre
open Xunit
open WetPancake.Pancake
open WetPancake
module UnitTests =
module UnitTests =
[<Fact>]
let RandomTest1()=
let result = RequestRandomText
Assert.NotNull(result)
[<Fact>]
let ``Random Text does not generate a null string`` () =
let result = Pancake.RequestRandomText
Assert.NotNull(result)

12
TestCentre/packages.config

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.ValueTuple" version="4.4.0" targetFramework="net471" />
<package id="xunit" version="2.3.1" targetFramework="net471" />
<package id="xunit.abstractions" version="2.0.1" targetFramework="net471" />
<package id="xunit.analyzers" version="0.7.0" targetFramework="net471" />
<package id="xunit.assert" version="2.3.1" targetFramework="net471" />
<package id="xunit.core" version="2.3.1" targetFramework="net471" />
<package id="xunit.extensibility.core" version="2.3.1" targetFramework="net471" />
<package id="xunit.extensibility.execution" version="2.3.1" targetFramework="net471" />
<package id="xunit.runner.visualstudio" version="2.3.1" targetFramework="net471" developmentDependency="true" />
</packages>

10
WetPancake.sln

@ -7,7 +7,7 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "WetPancake", "WetPancake\We
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WetPancakeCLI", "WetPancakeCLI\WetPancakeCLI.csproj", "{87C61362-58D8-4D79-ABF3-F356041F5DEC}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "TestCentre", "TestCentre\TestCentre.fsproj", "{1424BA46-9BB9-49CE-85B4-59E3208343CE}"
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "TestCentre", "TestCentre\TestCentre.fsproj", "{AA30074C-BEF2-4F2B-89F4-7069179B3AB7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -23,10 +23,10 @@ Global
{87C61362-58D8-4D79-ABF3-F356041F5DEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{87C61362-58D8-4D79-ABF3-F356041F5DEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{87C61362-58D8-4D79-ABF3-F356041F5DEC}.Release|Any CPU.Build.0 = Release|Any CPU
{1424BA46-9BB9-49CE-85B4-59E3208343CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1424BA46-9BB9-49CE-85B4-59E3208343CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1424BA46-9BB9-49CE-85B4-59E3208343CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1424BA46-9BB9-49CE-85B4-59E3208343CE}.Release|Any CPU.Build.0 = Release|Any CPU
{AA30074C-BEF2-4F2B-89F4-7069179B3AB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA30074C-BEF2-4F2B-89F4-7069179B3AB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA30074C-BEF2-4F2B-89F4-7069179B3AB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA30074C-BEF2-4F2B-89F4-7069179B3AB7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Loading…
Cancel
Save