User Tools

Site Tools


programming:faqcsharp

Yahtzee

Question:

Casting a string + int as a label in the score board, label name was correct but the resulting label was null.

Solution:

Score board labels were grouped under scoreCardPanel. Ex.: Label cLbl = (Label) scoreCardPanel.Controls[“computer” + labNum];

Tic-Tac-Toe

Question:

Computer plays twice for every user play.

Solution:

Check the form load event. The squares are enabled by default, so you don’t need to call a method to enable all the squares.

Events/Delegates

Nunit Testing

Question:

The test explorer does not show nUnit tests, null reference exception

Solution:

Nunit Test, setting up

Question:

How to set up test for project?

Solution:

  • Add a using.Nunit.Framework;
  • Right click on project, select manage NuGet packages. Browse for nUnit and install.

LINQ and Entity Framework

programming/faqcsharp.txt · Last modified: 2018/06/27 19:40 by swaimg