In the RaiseAssert test library, how to best assert that a tested method throws an exception of a certain type, without actually checking against the full exception instance? Currently, I'm doing this
but that requires specifying the full exception instance, not just its type.
EDIT: I now see that there indeed is an
isInstanceOf
method. Sorry.
arrow intensifies 1
β€οΈ 1
r
Riccardo Cardin
11/08/2024, 8:30 PM
Are you using the
assertj-arrow-core
testing library?
Riccardo Cardin
11/08/2024, 8:30 PM
What do you think about it?
d
David Kubecka
11/11/2024, 8:57 AM
Yes, I've been using that library for a short time. So far I used only simple stuff, mostly mimicking the assertj conventions. I would just appreciate more inline documentation of the top-level methods (e.g.
assertThatThrownBy
)
arrow intensifies 1
π 1
r
Riccardo Cardin
11/11/2024, 9:09 AM
Ok, thanks for the feedback. I'll try to add more documentation β€οΈ
Riccardo Cardin
11/22/2024, 9:34 AM
David, I released version 1.2.1 of the library. I tried to add some more doc. Let me know if itβs what you asked for π
d
David Kubecka
11/22/2024, 11:49 AM
Yes, that's better! It might be worth mentioning, though, that assertThatRaisedBy propagates the possible exception. And also that it throws an exception if the block succeeds. But this is really a small detail.