Learning to unit test – Isn’t it better to test code with conditions rather than try to implement a new framework with syntax?

Hello, I am learning to unit test my code in C#. The one thing that I have noticed when using frameworks like xunit, is that I am writing separate methods that the xunit can understand. So my method will be constructed in one way, and I am learning a new syntax to create a test method.

The problem is, when I change my own method, I have to then re-write my test method so that it looks similar and is testing for something.

I'm not sure if I am doing this correctly, but isn't it just better to use my method construct and then just test that, rather than trying to create a new type of testing method using different syntax.

submitted by /u/Marcusaurels
[link] [comments]

from Software Development – methodologies, techniques, and tools. Covering Agile, RUP, Waterfall + more! https://ift.tt/2KR9Ces

Leave a comment

Design a site like this with WordPress.com
Get started
search previous next tag category expand menu location phone mail time cart zoom edit close