Browse Source

rearrange required files for testing.

Remove unused files in library, add reset scripts in testing and update save location path in console tests.
master
Craig Oates 6 years ago
parent
commit
6fad701809
  1. BIN
      DeathSocket/1000x1000.png
  2. 2
      DeathSocket/DeathSocket.fsproj
  3. 2
      DeathSocket/IO.fs
  4. 2
      TestCentre/ConsoleTests.fs
  5. 3
      TestCentre/LoadingTestArea/AboutLoadingTestArea.txt
  6. BIN
      TestCentre/LoadingTestArea/LoadTest.png
  7. BIN
      TestCentre/LoadingTestArea/RequiredInfo/LoadTest.png
  8. 2
      TestCentre/SavingTestArea/AboutSavingTestArea.txt
  9. 39
      TestCentre/Script.fsx
  10. 7
      TestCentre/TestCentre.fsproj

BIN
DeathSocket/1000x1000.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

2
DeathSocket/DeathSocket.fsproj

@ -5,9 +5,7 @@
</PropertyGroup>
<ItemGroup>
<Content Include="1000x1000.png" />
<Compile Include="Domain.fs" />
<Compile Include="IO.fs" />
<Compile Include="Validation.fs" />
<Compile Include="ImageServices.fs" />
<Compile Include="GridPainter.fs" />

2
DeathSocket/IO.fs

@ -1,2 +0,0 @@
module IO

2
TestCentre/ConsoleTests.fs

@ -24,7 +24,7 @@
let loadLocation = __SOURCE_DIRECTORY__ + "/LoadingTestArea"
// File Path
let loadPath = loadLocation + "/LoadTest.png"
let loadPath = loadLocation + "/RequiredInfo/LoadTest.png"
let savePath = saveLocation + "/SaveTest.png"
(* Brushes converted to string [].

3
TestCentre/LoadingTestArea/AboutLoadingTestArea.txt

@ -1,3 +0,0 @@
This folder is the test area for loading images which are used in the Test Centre.
Images in here should not be deleted.
If you create a test which involves loading any pre-determined images (or any other content), please store it in this folder.

BIN
TestCentre/LoadingTestArea/LoadTest.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

BIN
TestCentre/LoadingTestArea/RequiredInfo/LoadTest.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

2
TestCentre/SavingTestArea/AboutSavingTestArea.txt

@ -1,2 +0,0 @@
This folder is the test area for saving the images produced in Test Centre.
When a test produces an image, it should save it in here and conduct any processing on it here also.

39
TestCentre/Script.fsx

@ -8,6 +8,39 @@ open System.Reflection
open SmoulderingBeachBall.Domain
open SmoulderingBeachBall.Services
open System.Threading
open System.IO
let loadLocation = __SOURCE_DIRECTORY__ + "/LoadingTestArea"
let saveLocation = __SOURCE_DIRECTORY__ + "/SavingTestArea"
let random = Random()
(*Resetting the Testing Area Folders Scripts
===============================================================================
The following scripts are for when you need to "manually" clear out the
LoadingTestArea and SavingTestArea folders. If you do not want to open up the
folder in Explorer and delete the files that way, just run the scripts in this
section. If you reset the LoadingTestArea, you will need to repopulate it using
the "Populating LoadingTestArea Folder Scripts" below. *)
let resetSavingTestArea () =
let files = Directory.GetFileSystemEntries(saveLocation, "*.png")
match files.Length with
| 0 -> ()
| _ ->
files
|> Array.iter (fun f -> File.Delete(f))
let resetLoadingTestArea () =
let files = Directory.GetFileSystemEntries(loadLocation, "*.png")
match files.Length with
| 0 -> ()
| _ ->
files
|> Array.iter (fun f -> File.Delete(f))
// Run these when the above functions have been added to F# interactive.
resetSavingTestArea ()
resetLoadingTestArea ()
(* Populating LoadingTestArea Folder Scripts
===============================================================================
@ -16,10 +49,6 @@ You can then use these images in LibraryTests.fs -- Property Tests.
The tests consists of loading images from LoadingTestArea, transforming them
and saving them in SavingTestArea. *)
let saveLocation = __SOURCE_DIRECTORY__ + "/LoadingTestArea"
let random = Random()
let allColours =
let properties =
typeof<Brushes>.GetProperties(BindingFlags.Public ||| BindingFlags.Static)
@ -42,7 +71,7 @@ let populateSpec sizes =
{ width = randomSize (sizes)
height = randomSize (sizes)
colour = (randomBrush ()) :?> Brush
filePath = saveLocation
filePath = loadLocation
overlay = None }
let generateSpecs amount =

7
TestCentre/TestCentre.fsproj

@ -45,13 +45,6 @@
</PropertyGroup>
<Import Project="$(FSharpTargetsPath)" />
<ItemGroup>
<Content Include="SavingTestArea\AboutSavingTestArea.txt" />
<Content Include="LoadingTestArea\AboutLoadingTestArea.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="LoadingTestArea\LoadTest.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="ConsoleTests.fs" />
<Compile Include="LibraryTests.fs" />

Loading…
Cancel
Save