April 19, 2017 Re: fluent-asserts released | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | On Wednesday, 12 April 2017 at 06:22:26 UTC, Ali Çehreli wrote: > On 04/11/2017 11:01 PM, Szabo Bogdan wrote: >>> >>> should.not.throwAnyException({ >>> throw new Exception("test"); >>> }); >> >> what do you mean, they are not documented? there is a md file fith some >> examples here: >> https://github.com/gedaiu/fluent-asserts/blob/v0.3.0/api/exceptions.md >> >> What do you think I can do to have the exception asserts to fit the style? > > The expression comes first in the other use cases. The following is not very pretty but seems to work with my proof of concept below: > > ({ > throw new Exception("test"); > }()).should.not.throwAnyException(); > > I checked the syntax with the following code: > > struct Should { > Should not() { > return this; > } > > Should throwAnyException() { > return this; > } > } > > Should should(E)(lazy E expr) { > return Should(); > } > > void main() { > ({ > throw new Exception("test"); > }()).should.not.throwAnyException(); > } > > Ali Hi! I managed to make another update to the library. http://fluentasserts.szabobogdan.com/ Based on your feedback I updated the exception asserts and I added some new ones like `Between` and `Approximately`. Also now it works with unit-threaded. Thanks for the feedback! |
Copyright © 1999-2021 by the D Language Foundation