Quantcast
Channel: Fluent Assertions
Browsing all 1402 articles
Browse latest View live

New Post: Conditional Assertion with When/Unless

On what specific assertion?

View Article


New Post: Reverse collection assertion

I ran into a situation that I need verify if a number is one of known values. Not sure how this can be done easily. I tried to create a collection and use it to verify it. But don'e like it because the...

View Article


New Post: Reverse collection assertion

There is a BeInRange() method for various numeric types, and you could use obj.Should().Match(lambda).

View Article

New Post: Conditional Assertion with When/Unless

Sorry, I did not make it clear. Here is an example: a.Should().Must(...).When(x => x.Status == "Queued") ; This should be verified only when status of the object is "Queued"), which is equivalent to...

View Article

New Post: Reverse collection assertion

Yes. My problem is that I have a configuration value which can only take a few specific values. For example, a value x is supposed to be only one of the following values: 2, 3, 5, 7, 11. It will be...

View Article


New Post: Reverse collection assertion

Sounds like a great idea. Please create an issue for it if you want this in the next release.

View Article

New Post: Asserts as extension methods

You are right, something was wrong with my working copy. Some time ago we were talking about nesting type-specific assertions from NumericAssertions. I am not sure whether you are working on it or...

View Article

New Post: Asserts as extension methods

Did you check the changes I checked in on the 28th? I've eliminated almost all extension methods with the exception of BeApproximatelly(). And I've moved those few extension methods back to the...

View Article


New Post: Asserts as extension methods

I have seen that NullableNumericAssertions related stuff. It is a bit dirty but it works :) I just thought you wanted to get rid of NumericAssertionsExtensions at all. But you are right, it doesn't...

View Article


New Post: Replacement for Debug.Assert

Would it be possible to use FluentAsswertion as replacement of Debug.Assert since it's a lot more feature rich? is there a way to make fluent assertion to not throw or even possibly not evaluate the...

View Article

New Post: Replacement for Debug.Assert

maybe using ConditionalAttribute http://msdn.microsoft.com/en-us/library/system.diagnostics.conditionalattribute.aspx

View Article

New Post: Replacement for Debug.Assert

Not out-of-the-box. You would have to wrap the code in the Execute class with such an attribute. But it's something that's outside the scope of FA, so we will not offer something like that as part of...

View Article

Commented Issue: BePositive() does not work for float and double [11946]

This throws a exceptinon: double f = 3.8f; f.Should().BePositive();I looked at the code and the Subject.CompareTo(0) > 0 does not work with float and double. And the comment is wrong. As it is...

View Article


New Post: FluentAssertions advantages

I am working FluentAssertions presentation for our local community. Could you please help me formulating FA advantages? Here what I see: 1. The richest set of assertions 2. Convenient fluent syntax...

View Article

New Post: FluentAssertions advantages

Have you read my original blog post at http://www.dennisdoomen.net/2011/07/why-i-created-fluent-assertions-in.html 4. Active development 5. Upcoming support for .NET 4.5, WP7 and WinRT (already in the...

View Article


New Post: Error message for Be

I have the following code in test:   var result = _target.Execute(...); //returns double result.Should().Be(100); And I get the following assertions error message: "Expected value 400 to be exactly...

View Article

New Post: Error message for Be

I don't think you're testing with the source code version, because that specific error message only happens in de 1.7.x branch. Since I've refactored the numeric assertions two weeks ago, all numeric...

View Article


New Post: Conditional Assertion with When/Unless

I'm afraid that will be difficult to implement. The When() would follow the BeXXX() method, and therefor doesn't get a chance the evaluate the condition.

View Article

Source code checked in, #75832

Major redesign of the structural assertion verification logic

View Article

Commented Issue: AllProperties().IncludingNestedObjects() throws exception on...

The following code causes an exception in 1.7.1.1:var obj1 = new { Bytes = new byte[] { 1, 2, 3, 4 }, Obj = new { A = 1, B = 2 } };var obj2 = new { Bytes = new byte[] { 1, 2, 3, 4 }, Obj = new { A = 1,...

View Article
Browsing all 1402 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>