Closed Issue: Better error msg when AllProperties() fails on DateTime [11839]
Include the property name in the error message when the property is a DateTime. [TestMethod] public void Should() { var expected = new Car {MfgDate= new DateTime(2011, 1, 1)}; var actual = new Car {...
View ArticleClosed Issue: XElementAssertions.HaveElement() throws funny error messages...
XElementAssertions.HaveElement() throws a funny error message (because we [...] message) although I didn't specify a reason.CodeSnippet: xml.Element("Root") .Should().HaveElement("Children");I get the...
View ArticleReopened Issue: Compare non-nullable to nullable types [11837]
It would be nice to support this scenario: var number = 5; var nullableNumber = (int?) 5; number.Should().Be(nullableNumber);is better than: number.Should().Be(nullableNumber.Value)when nullableNumber...
View ArticleSource code checked in, #74796
Updated the 1.7.1 nuget package to include the XML framework dependencies.
View ArticleNew Post: Asserts as extension methods
I am playing with it now. I got the problem you had: you can not specify "where T: IComparable" for NumericAssertions as this type is used also by Nullable types (which do not implement IComparable)....
View ArticleNew Post: CollectionPropertyAssertions
Here is the best "solution" I came to. First, we split ShouldHave methods: public static IPropertyAssertions<T> ShouldHave<T>(this T subject) { return new...
View ArticleNew Post: CollectionPropertyAssertions
Thanks for thinking with me, but I'm afraid your solution won't improve the situation much, but it will be a breaking chance for existing FA users. Or am I reading you wrong?
View ArticleNew Post: CollectionPropertyAssertions
I am not sure. The idea is that we can make C# pass enumeration element type as T argument of CollectionPropertyAssertions which makes it possible to impelement Properties, But, etc.
View ArticleNew Post: CollectionPropertyAssertions
Ah, I see were you're getting to. If we would add that extra overload, and callers specify the actual enumeration element type, they could use the same properties as the ones we have for simple types....
View ArticleNew Post: CollectionPropertyAssertions
Yep, you got me right. By the way, I have asked question at SO about this situation: http://stackoverflow.com/questions/9860026/extension-methods-overload-choice May be this discussion will be useful...
View ArticleNew Post: CollectionPropertyAssertions
One of the answers suggest something similar to what I was talking initially: to have separate extension methods names for collections (e. g. CollectionShould, CollectionShouldHave). Actually it is...
View ArticleCreated Issue: Add support for collection.Should().Equal(lambda) [11925]
Add support for passing in a lambda expression that collection.Should().Equal() will use to compare the invididual items.See this StackOverflow discussion for its...
View ArticleCreated 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 ArticleCreated 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 ArticleCommented 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 ArticleSource code checked in, #75217
Reorganized the numeric assertions to rely less on extension methods and support comparing to nullable values as well.
View ArticleClosed Issue: Compare non-nullable to nullable types [11837]
It would be nice to support this scenario: var number = 5; var nullableNumber = (int?) 5; number.Should().Be(nullableNumber);is better than: number.Should().Be(nullableNumber.Value)when nullableNumber...
View ArticleReopened Issue: Compare non-nullable to nullable types [11837]
It would be nice to support this scenario: var number = 5; var nullableNumber = (int?) 5; number.Should().Be(nullableNumber);is better than: number.Should().Be(nullableNumber.Value)when nullableNumber...
View ArticleClosed Issue: Framework dependencies in nuget package [11761]
Please add System.Xml and System.Xml.Linq in the nuget package definition as a framework dependency so that I do not have to add them manually.btw: what new feature requires these...
View Article