23 changed files with 370 additions and 52 deletions
@ -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 |
||||
() |
@ -0,0 +1,114 @@
|
||||
<?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> |
||||
<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> |
||||
<Content Include="TextFiles\desktop-clock-info.txt" /> |
||||
<Content Include="TextFiles\console-waterworks-announcement.txt" /> |
||||
<Content Include="TextFiles\word-generator.txt" /> |
||||
<Compile Include="AssemblyInfo.fs" /> |
||||
<Compile Include="TestingConstants.fs" /> |
||||
<Compile Include="UnitTests.fs" /> |
||||
<None Include="Script.fsx" /> |
||||
<Content Include="packages.config" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Reference Include="FSharp.Core"> |
||||
<HintPath>..\packages\FSharp.Core.4.5.0\lib\net45\FSharp.Core.dll</HintPath> |
||||
</Reference> |
||||
<Reference Include="mscorlib" /> |
||||
<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"> |
||||
<Name>WetPancake</Name> |
||||
<Project>{cb878c2d-edba-490b-b6b3-01b57779a28f}</Project> |
||||
<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.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> |
@ -0,0 +1,10 @@
|
||||
module TestingConstants |
||||
|
||||
[<Literal>] |
||||
let DesktopClock = __SOURCE_DIRECTORY__ + @"\TextFiles\desktop-clock-info.txt" |
||||
|
||||
[<Literal>] |
||||
let ConsoleWaterworks = __SOURCE_DIRECTORY__ + @"\TextFiles\console-waterworks-announcement.txt" |
||||
|
||||
[<Literal>] |
||||
let WordGenerator = __SOURCE_DIRECTORY__ + @"\TextFiles\word-generator.txt" |
@ -0,0 +1,21 @@
|
||||
That's right, you've won. Well done and come on down, today is not your lucky day. It's -- in fact -- the best day of your life. How else can you describe the moment you discovered the Console.Waterworks NuGet package? That's right, you can't. So, let's get on with basking in your glory. I can't wait. |
||||
|
||||
First of all, Console.Waterworks is for writing extendable command-based console programs. Gone are the days where you need to parse user input and write error handling code. You now have the ability to write methods which act as commands at run-time. Method parameters are, also, accepted and parsed at run-time. This is brilliant and in need of a demonstration. Are you ready to see something which surpasses the hype and majesty of the sun herself? Well, come on then. It's demo. time. |
||||
|
||||
As you can see in the Gif. above, the method I have written (on the left) maps to a command in the console program at run-time (on the right). There is no parsing of user input or error handling in the code, either. Don't worry, you'll be reading more about that majestic trick-shot in a moment. For now, enjoy the flashing lights. You've earned it. |
||||
|
||||
We both know you're not an idiot. So, when you recognise the brilliance, you know it's one-hundred percent legitimate. This is a fair assessment. And, this next intellectual marvel will elevate your core being to a state of ecstasy. Yes, you're right. I'm about to render you stupid through the sheer splendour of intellectual stimulation. It's going to be so strong, you might consider it a form of infidelity. Let's hope you can keep your wits about you. This is your relationship at risk here, not mine. Come on you little cupcake. Let's demo. |
||||
|
||||
This demo. is the one about the error handling I mentioned earlier. As you can see in the Gif., the method doesn't have any error handling code. But, the console program displays an error message to the user. Yes, you're right. It's brilliant. |
||||
|
||||
This next demo. is where everything changes, though. I hope you've strapped your pants on tight. |
||||
|
||||
In a moment as clear as crystal, what you’re looking at is a self-documenting "help" section. This means you no longer need to write a help guide -- from scratch -- in every console program. You can now add Waterworks custom attributes to the methods you want to declare at run-time. Console.Waterworks will make a note of those attributes and display them like the demo. shows. |
||||
|
||||
Everything above is brilliant and has a place on this Earth and you know this. Like I said before, you're not an idiot. So, the next time you're writing a console program, don't forget to add Console.Waterworks to your solution. |
||||
|
||||
For more information about using Console.Waterworks in your solution, head to the GitHub. Console.Waterworks is available as a .Net and .Net Core NuGet package. |
||||
|
||||
Thank you for your time and I look forward to your words of recommendation about me reach me. And, when I say "reach me", I don't me via you. I mean via other people talking about you and on your behalf. |
||||
|
||||
Thanks again. |
@ -0,0 +1,8 @@
|
||||
Are you the type of person who hates work? Are you someone who resents the fact you're born into a system not of your choosing? Are your teachers lazy, dismissive and not interested in your education? We're looking at you Mr.Heath... Then you need Word Generator. The app for students with a deadline. |
||||
Imagine you're at home and finishing off your English essay for Mr. Dillbank. A teacher who is always drunk and has been struggling to put a sentence together since 2014. He never used to be this way but Maureen had to leave him for Derek, the Head of Music at Barnworth High. He isn't even good looking. He looks like an orange balloon with pigeon droppings for a moustache. Who, in the history of mankind, thought that was a good look? No one! That's who! Screw you Derek! Screw you! You're fooling no one with that hair piece... |
||||
... |
||||
Sorry... I got a little side-tracked there.... |
||||
Anyway, where was I... |
||||
So, you're finishing your essay and you realise your word count is lower than the expected one. Two-hundred words short, as a matter of fact. This is infuriating because you're supposed to be playing football in twenty minutes. You don't have enough time to add two-hundred words and be ready in time for football. What do you do? You open Word Generator of course. You add the extra words in a few clicks and your already off to football, with time to spare. Your mum only checks the word count these days and Mr. Dillbank hasn't seen straight for years. They think you have done your homework and you get to play football. Everyone is a winner here, apart from you in the long term but that's ok. It's not ok but it feels ok and that's what counts right now. |
||||
So, you're sold. You're in and wanting to know more. How does it work? I'm glad you asked. It uses the latest in space-age technology. Word Generator utilises the Markov Chain algorithm. When you boot Word Generator up, feed it a plain text (.txt) file and specify what Markov Value you want to use. Using that information, it spits out text that resembles the original text. This helps hide the deception. |
||||
Just in case you're wondering, the Markov Value is a number. For the app it's a number between one and ten. The higher the number the closer the generated text will resemble the original text. For example, a value of one will generate non-sense and ten will spit out like-for-like text. If you're feeling confident, I recommend you turn it up to five and see if teachers like Mr. Dillbank notices. |
@ -0,0 +1,53 @@
|
||||
namespace TestCentre |
||||
|
||||
module ``Unit Tests`` = |
||||
|
||||
open Xunit |
||||
open WetPancake |
||||
open TestingConstants |
||||
open System.IO |
||||
|
||||
(*These tests check to see if the .txt files exists in the Test Centre project. |
||||
The Wet Pancake library does not expose the file access functions so the .txt |
||||
files are mirrored here (in Text Centre) |
||||
The mirroring, also, doubles up as sample files to pass into Wet Pancake.*) |
||||
[<Fact>] |
||||
let ``desktop-clock-info-txt can be found`` () = |
||||
let result = File.Exists DesktopClock |
||||
Assert.Equal(true, result); |
||||
|
||||
[<Fact>] |
||||
let ``console-waterworks-announcements-txt can be found`` () = |
||||
let result = File.Exists ConsoleWaterworks |
||||
Assert.Equal(true, result); |
||||
|
||||
[<Fact>] |
||||
let ``word-generator-txt can be found`` () = |
||||
let result = File.Exists WordGenerator |
||||
Assert.Equal(true, result); |
||||
|
||||
|
||||
[<Fact>] |
||||
let ``Request Random Text does not generate a null`` () = |
||||
let result = Pancake.RequestRandomText |
||||
Assert.NotNull result |
||||
|
||||
[<Fact>] |
||||
let ``Request Text does not generate a null`` () = |
||||
let result = Pancake.RequestText 5 5 |
||||
Assert.NotNull result |
||||
|
||||
[<Fact>] |
||||
let ``Request Text From File does not generate a null for desktop-clock-info-txt`` () = |
||||
let result = Pancake.RequestTextFromFile 5 5 DesktopClock |
||||
Assert.NotNull result |
||||
|
||||
[<Fact>] |
||||
let ``Request Text From File does not generate a null for console-waterworks-announcement-txt`` () = |
||||
let result = Pancake.RequestTextFromFile 5 5 ConsoleWaterworks |
||||
Assert.NotNull result |
||||
|
||||
[<Fact>] |
||||
let ``Request Text From File does not generate a null for word-generator-txt`` () = |
||||
let result = Pancake.RequestTextFromFile 5 5 WordGenerator |
||||
Assert.NotNull result |
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<packages> |
||||
<package id="FSharp.Core" version="4.5.0" targetFramework="net471" /> |
||||
<package id="System.ValueTuple" version="4.5.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.9.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> |
@ -0,0 +1,8 @@
|
||||
Are you the type of person who hates work? Are you someone who resents the fact you're born into a system not of your choosing? Are your teachers lazy, dismissive and not interested in your education? We're looking at you Mr.Heath... Then you need Word Generator. The app for students with a deadline. |
||||
Imagine you're at home and finishing off your English essay for Mr. Dillbank. A teacher who is always drunk and has been struggling to put a sentence together since 2014. He never used to be this way but Maureen had to leave him for Derek, the Head of Music at Barnworth High. He isn't even good looking. He looks like an orange balloon with pigeon droppings for a moustache. Who, in the history of mankind, thought that was a good look? No one! That's who! Screw you Derek! Screw you! You're fooling no one with that hair piece... |
||||
... |
||||
Sorry... I got a little side-tracked there.... |
||||
Anyway, where was I... |
||||
So, you're finishing your essay and you realise your word count is lower than the expected one. Two-hundred words short, as a matter of fact. This is infuriating because you're supposed to be playing football in twenty minutes. You don't have enough time to add two-hundred words and be ready in time for football. What do you do? You open Word Generator of course. You add the extra words in a few clicks and your already off to football, with time to spare. Your mum only checks the word count these days and Mr. Dillbank hasn't seen straight for years. They think you have done your homework and you get to play football. Everyone is a winner here, apart from you in the long term but that's ok. It's not ok but it feels ok and that's what counts right now. |
||||
So, you're sold. You're in and wanting to know more. How does it work? I'm glad you asked. It uses the latest in space-age technology. Word Generator utilises the Markov Chain algorithm. When you boot Word Generator up, feed it a plain text (.txt) file and specify what Markov Value you want to use. Using that information, it spits out text that resembles the original text. This helps hide the deception. |
||||
Just in case you're wondering, the Markov Value is a number. For the app it's a number between one and ten. The higher the number the closer the generated text will resemble the original text. For example, a value of one will generate non-sense and ten will spit out like-for-like text. If you're feeling confident, I recommend you turn it up to five and see if teachers like Mr. Dillbank notices. |
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<packages> |
||||
<package id="System.ValueTuple" version="4.4.0" targetFramework="net471" /> |
||||
<package id="System.ValueTuple" version="4.5.0" targetFramework="net471" /> |
||||
</packages> |
Loading…
Reference in new issue