In this repository you can find (visual studio) start solutions for the exercises of the .NET Advanced course of PXL-Digital.
The exercises are grouped in parts. In each part there is one (Visual Studio) solution for each exercise. An exercise solution contains multiple projects:
- One or more project for the exercise. E.g. CardGames.Desktop and CardGames.Domain
- One or more test projects for the exercise projects. E.g. CardGames.Domain.Tests
The exercise projects are (mostly) empty and waiting for you to complete them. The matching test projects contain automated tests that can be run to check if your solution is correct.
The start solutions of the lab assignments with GUTS support can be found in these folders:
- 1_LanguageFeatures - C# Language features
- 2_MVC_EF_NUnit- ASP.NET Core MVC & Entity Framework & NUnit
- 3_API - ASP.NET Rest API
We will work with GitHub Classroom for the Guts exercises. The idea is that you make an online fork of the repository containing the startcode of the exercises. Only you (and the lectors) will have access to this online copy.
To proceed you need a GitHub account. If you don't have one yet, register youself via https://github.com.
Now go to https://classroom.github.com/a/R_EBaiWe
Accept the assignment and GitHub will make that online fork of the repository containing the startcode. GitHub Classroom will show you the url of your repository. Navigate to this url and mark it as a favorite in your browser.
Next you need to clone the files in your online repository to your local machine. You will use the Visual Studio git capabilities to accomplish this. Start Visual Studio and select "Clone or check out code".
- Click on the Clone or Download button in the upper right corner of this webpage
- Copy the url of this repository
- Paste the url you copied earlier into the field "Repository Location"
- Choose a local path, this is a local folder where the files will be copied to
- Click on the Clone button
Now you have a local copy of the online repository in which you can complete your exercises.
Double click the solution that contains the exercises you want to work on. Alternatively, you can just double click a solution file (.sln) from an explorer window to start up Visual Studio with the solution opened up.
Exercises will be added and changes will be made during the course. These changes will happen in the original repository made by the lectors (your online repository is a fork of this repository). We will call the original repository of the lectors the upstream repository. Your personal online repository will be called the origin from now on.
You need a way to pull changes in the upstream repository into the origin repository. Follow the instructions below to make this possible.
Your personal GitHub page will show the following message if there are updates in the upstream repository:
To update your repo you can click on the Sync Fork button:

Alternatively it is possible that the lectors made a Pull Request to your repository:
You can accept en merge this pull request to get your (online) repo up-to-date!
Finally pull the changes into your local repository:
Register on guts-web.pxl.be
To be able to send your tests results to the Guts servers you need to register via guts-web.pxl.be. After registration you will have the credentials you need to succesfully run automated tests for an exercise.
-
Open the solution of the exercise. You can do this by doubleclicking on the .sln file from an explorer window or by opening visual studio, clicking on File → Open a project or solution and selecting the .sln file.
-
Build the solution (Menu: Build → Build Solution or Ctrl+Shift+B)
-
Write the code you need to write
- Open the Test Explorer window (Menu: Test → Test Explorer)
- In the top right corner, click on the group by button and make sure the automated tests are grouped by project (see the picture below). If you don't see any tests appearing, you probably should (re)build your solution.
- Right click on the project that matches your exercise and click on Run to execute the tests.
- The first time you run a test a browser window will appear asking you to log in. You should fill in your credentials from guts-web.pxl.be.
Why won't my tests run?
The first time it can happen that you see the tests in the Test Explorer but if you run the tests, nothing happens. Try to clean your solution (Build → Clean Solution) and then to rebuild your solution (Build → Rebuild solution).
Why can't I see my test results on the Guts website? Locally all my tests are green.
After the tests are run, the testrunner will try to send your results to the server. In the Output Window you can see a log of the steps that are taken. If anything goes wrong, you should be able to find more info in the Output Window.
The test results will only be sent to the server when you run all te tests of an exercise at once. If you run the tests one by one the results will not be sent to the servers.
Tests that pass will be green. Tests that don't pass will be red.
The name of the test gives an indication of what is tested in the automated test. If you click on a test you can also read more detailed messages that may help you to find out what is going wrong.
Although it is not a guarantee, having all tests green is a good indication that you completed the exercise correctly.
Test results of all students are sent to the Guts servers. You can check your progress and compare with the averages of other students via guts-web.pxl.be. Login, go to ".NET Advanced" in the navigation bar and select the chapter (module) you want to view.
It could happen that the code in the online repository changes and that you need to pull (download) a new version of the start code in your local repository. The online repository does not contain your solutions. Pulling a new version of the code could result in you losing your work.
To avoid this you should regularly commit (save) your work in your local git database. If you have commited your work an you pull a new version, git will be able to automatically merge your work with the online changes. It is recommended to do a git commit every time you complete an exercise.
- Go to Git Changes
- In the Git Changes screen you get an overview of the changes you made locally. Fill in a commit message (describing what you did) and click on the Commit All button. Your changes are now saved in your local git database.
- By clicking on the Solution Explorer tab you go back to the main view for this local repository













