add images to Console and Library Tests Overview.

master
Craig Oates 5 years ago
parent
commit
27628d3627
  1. 12
      Console-and-Library-Tests-Overview.md
  2. BIN
      attachments/add-new-folder-screenshot.png
  3. BIN
      attachments/test-explorer-screenshot-simple.png
  4. BIN
      attachments/test-files-basic-structure.png

12
Console-and-Library-Tests-Overview.md

@ -3,13 +3,13 @@ Instead of going through both of the main testing files (I.E. "ConsoleTests.fs"
- [ConsoleTests.fs](https://gitlab.com/craig.oates/Death-Socket/blob/master/TestCentre/ConsoleTests.fs)
- [LibraryTests.fs](https://gitlab.com/craig.oates/Death-Socket/blob/master/TestCentre/LibraryTests.fs)
The general structure for each file is the same. Each one has a module called `PropertyTests` with "helper" functions at the top of them. It is worth pointing out both of these modules live in name-spaces. This is what allows both "testing" files to use the same module name. If you are wondering why I did it this way, it is because it makes it easier to read the Test Explorer (in Visual Studio). For now, the only unit tests you will see are in "ConsoleTests.fs", residing in the `UnitTests` module.
The general structure for each file is the same. Each one has a module called `PropertyTests` with "helper" functions at the top of them. It is worth pointing out both of these modules live in name-spaces. This is what allows both "testing" files to use the same module name. If you are wondering why I did it this way, it is because it makes it easier to read the Test Explorer (in Visual Studio).
IMAGE OF TEST EXPLORER.
![test explorere screenshot simple](attachments/test-explorer-screenshot-simple.png)
As an aside, I have kept the "helper" functions next to the actual tests for a reason: to avoid "over-engineering". It seemed a little excessive to "modularise" everything with such a small amount of tests. Although, I admit this approach will need to change if the repository grows in the future. If/when that time comes, TestCentre will need refactoring. Keep this in mind if you decide to add your own changes/features.
TEST FILE BREAKDOWN.
![test files basic structure](attachments/test-files-basic-structure.png).
One way to denote a property test from a unit test is by looking at their attributes. If a test has `[<Property>]` next to it, it is a property test. If a test has `[<Fact>]` next to it, it is a unit test. For example,
@ -35,8 +35,8 @@ let ``Can create an image with a full overlay`` () =
As stated in other parts of this wiki, make sure you have a folder called "SavingTestArea" within TestCentre. If you do not have this folder on your machine, a lot of the tests will fail. This is because TestCentre uses it as a place to save and check the images it creates. To help you check, here is what your TestCentre project should look like:
IMAGE OF FILE STRUCTURE IN TESTCENTRE.
![testcenre file structure](attachments/testcentre-file-structure.png)
The easiest way to add this folder to TestCentre is by right-clicking on "TestCentre" in Visual Studio's Solution Explorer. From there, head to _Add -> New Folder_. Having said that, you can add the "SavingTestArea" folder to TestCentre with File Explorer if you want. This is because Visual Studio does not need to know it exists. You just need it on your machine.
The easiest way to add this folder to TestCentre is by right-clicking on "TestCentre" in Visual Studio's Solution Explorer. From there, head to *Add -> New Folder*. Having said that, you can add the "SavingTestArea" folder to TestCentre with File Explorer if you want. This is because Visual Studio does not need to know it exists. You just need it on your machine.
SCREENSHOT OF ADDING A NEW FOLDER.
![add new folder screenshot](attachments/add-new-folder-screenshot.png)

BIN
attachments/add-new-folder-screenshot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 KiB

BIN
attachments/test-explorer-screenshot-simple.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
attachments/test-files-basic-structure.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Loading…
Cancel
Save