Skip to main content
Remove meta lead in. Write out small numbers (see http://english.stackexchange.com/q/979/40348 )
Source Link
user40980
user40980

Great question.

I don't think it's necessarily a bad thing, but I do think we should strive towards only having single asserts in our tests. This means you write a lot more tests and our tests would end up testing only one thing at a time.

Having said that, I would say maybe half of my tests actually only have 1one assert. I think it only becomes a code (test?) smell when you have about 5five or more asserts in your test.

How do you solve multiple asserts?

Great question.

I don't think it's necessarily a bad thing, but I do think we should strive towards only having single asserts in our tests. This means you write a lot more tests and our tests would end up testing only one thing at a time.

Having said that, I would say maybe half of my tests actually only have 1 assert. I think it only becomes a code (test?) smell when you have about 5 or more asserts in your test.

How do you solve multiple asserts?

I don't think it's necessarily a bad thing, but I do think we should strive towards only having single asserts in our tests. This means you write a lot more tests and our tests would end up testing only one thing at a time.

Having said that, I would say maybe half of my tests actually only have one assert. I think it only becomes a code (test?) smell when you have about five or more asserts in your test.

How do you solve multiple asserts?

added 132 characters in body
Source Link
Jaco Pretorius
  • 4k
  • 2
  • 30
  • 38

Great question.

I don't think it's necessarily a bad thing, but I do think we should strive towards only having single asserts in our tests. This means you write a lot more tests and our tests would end up testing only one thing at a time.

Having said that, I would say maybe half of my tests actually only have 1 assert. I think it only becomes a code (test?) smell when you have about 5 or more asserts in your test.

How do you solve multiple asserts?

Great question.

I don't think it's necessarily a bad thing, but I do think we should strive towards only having single asserts in our tests. This means you write a lot more tests and our tests would end up testing only one thing at a time.

Having said that, I would say maybe half of my tests actually only have 1 assert. I think it only becomes a code (test?) smell when you have about 5 or more asserts in your test.

Great question.

I don't think it's necessarily a bad thing, but I do think we should strive towards only having single asserts in our tests. This means you write a lot more tests and our tests would end up testing only one thing at a time.

Having said that, I would say maybe half of my tests actually only have 1 assert. I think it only becomes a code (test?) smell when you have about 5 or more asserts in your test.

How do you solve multiple asserts?

Post Made Community Wiki
Source Link
Jaco Pretorius
  • 4k
  • 2
  • 30
  • 38

Great question.

I don't think it's necessarily a bad thing, but I do think we should strive towards only having single asserts in our tests. This means you write a lot more tests and our tests would end up testing only one thing at a time.

Having said that, I would say maybe half of my tests actually only have 1 assert. I think it only becomes a code (test?) smell when you have about 5 or more asserts in your test.