LaunchCodeEducation / LaunchCodeEducation/CSharp6-TechJobs-OO

C# assignment 2: False test failures on Windows Visual Studio 2022

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
0
Forks
33
PR merge metrics
No merged PRs in 30d

Description

There is an issue with learners using Visual Studio 2022 on Windows OS getting false test failures.
Failing tests:
TestTaskTwo.cs

  • Test_Second_Location_Constructor_Initializes_Id

TestTaskFive.cs

  • Test_TestToString_Starts_And_Ends_With_NewLine
  • Test_TestToStringHandlesEmptyField

The test methods are written to expect a specific order of execution (the order the methods are written in code - VS2022 on Mac executes test methods this way), however, VS2022 on Windows runs the test methods alphabetically by method name. This is causing failures due to mismatching ID properties.

The two tests in TestTaskFive are also comparing output with text files created using \n as the line separator. These also fail on Windows due to the line separator being \r\n on that platform.

There is a PR to fix these issues: #1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review PR #1 alongside TestTaskTwo.cs and TestTaskFive.cs, then run the three listed tests in Visual Studio 2022 on Windows and Mac. Done means the constructor and ToString tests pass on both platforms without relying on test execution order or a platform-specific line separator.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.