Jonas Nyrup
Jonas Nyrup
Here's what I imagine to be a closer to real-life scenario. ```cs public abstract class Uploader { public abstract void Upload(); } public class NoopUploader : Uploader { public override...
@frankschierle From your code snippet it looks like you need to distinguish between [Compile-time types vs. run-time types](https://fluentassertions.com/documentation/#compile-time-types-vs-run-time-types). To use runtime-time types instead of compile-time types, write `types1.Should().BeEquivalentTo(types2, options =>...
@frankschierle I see. You can use `types1.Should().BeEquivalentTo(types2 as IEnumerable, options => options.RespectingRuntimeTypes());` If that's not an option, please open a new issue as your issue is different from this.
Yes, It's still relevant. `CollectionA` inherits from `IEnumerable`, but _also_ has an extra property `Y`, which should be taken into account in the object comparison.
Fiddled a bit with this, and replacing the current approach with a _correct_ implementation was straight forward. https://github.com/jnyrup/fluentassertions/tree/issue1486 ```cs private void AssertElementGraphEquivalencyWithLooseOrdering(object[] subjects, T[] expectations) { var predicatesList = expectations.Select((e,...
Two possible workarounds until this (hopefully) is better supported: ```c# collection.Should().Contain(e => string.Equals(e, "Text3", StringComparison.OrdinalIgnoreCase)); collection.Should().ContainEquivalentOf("Text3", opt => opt .Using(ctx => ctx.Subject.Should().BeEquivalentTo(ctx.Expectation)) .WhenTypeIs()); ```
Hi @JonathanMagnan According to https://dotnetfiddle.net/s1jy96 ```csharp using System; public class Program { public static void Main() { Console.WriteLine(Boxing(1)); Console.WriteLine(NoBoxing(1)); } private static string Boxing(int i){ return "a" + i; }...
`ToString` is called in either case -- at some point the int needs to be converted into a string representation. If not called explicitly, it is done inside `Concat(object, object)`....
@richardwerkman `sin x = cos x` for `(4 pi n + pi)/4` (45 degrees and 225 degrees). https://www.wolframalpha.com/input/?i=Cos+x+%3D+sin+x That concern seems no different that min/max and floor/ceiling giving same result...
I intentionally used named arguments whenever necessary to avoid specifying additional optional arguments. Searching the existing codebase there it at least 22 places where there is a mix of named...