-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Description
Hi there,
It seems that you've misunderstood TDD in terms of fail first. Yes, a test must fail the first time, but it is not because it is written wrong, it's because the business logic should not yet have been implemented. Once the test fails you then fix your business logic or method and once you've done that properly your test will pass.
My recommendation:
- Start by implementing the stubs of WordCount
- Write the correct tests the first time. The test will fail because you haven't implemented the actual WordCount only empty stubs.
- Implement WordCount so that the tests pass
= TDD
Writing a wrong test that fails and then correcting the test to pass is not TDD - I'm pretty sure it doesn't have a name or purpose.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 98d01d28-eba7-401c-5716-1361edfa928d
- Version Independent ID: f235603a-edcc-257a-901e-b0709cf81053
- Content: Building a complete .NET Core solution on macOS using Visual Studio for Mac
- Content Source: docs/core/tutorials/using-on-mac-vs-full-solution.md
- Product: dotnet-core
- GitHub Login: @guardrex
- Microsoft Alias: mairaw
patarapolw and galrito
Metadata
Metadata
Assignees
Labels
⌚ Not TriagedNot triagedNot triaged