[go-nuts] Testing best practice: passing and failing test

2016-06-16 Thread Henry
Typically, you should use one test case for each scenario. That being said, there is nothing preventing you to cram many scenarios into one test case. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiv

[go-nuts] Testing best practice: passing and failing test

2016-06-16 Thread Rayland
Let's say I have some piece of code like this: type Foo struct { } func (this *Foo) Do() { } If I want to test that method Foo will pass in a certain scenario and fail in another scenario should I have a test for each scenario or should I have all scenarios tested in a method TestFoo_Do()?