DLR/dynamic support
See original GitHub issueHi, Is there a way to make FluentAssertions work with dynamic/DLR? Consider the following code:
dynamic expando = new ExpandoObject();
expando.someVar = "string";
expando.someVar.Should().Be("string");
which throws Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
: “‘string’ does not contain a definition for ‘Should’”
Thanks!
Issue Analytics
- State:
- Created 9 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Dynamic Language Runtime
The Dynamic Language Runtime (DLR) from Microsoft runs on top of the Common Language Runtime (CLR) and provides computer language services for dynamic...
Read more >Dynamic Language Runtime Overview - .NET Framework
The DLR adds dynamic objects to C# and Visual Basic to support dynamic behavior in these languages and enable their interoperation with dynamic...
Read more >Grokking the DLR: Why it's Not Just for Dynamic Languages
With dynamic type support now baked into C# and Visual Basic, the DLR has become a gateway from our favorite .NET languages to...
Read more >Exploring the Dynamic Language Runtime in .Net
The DLR (Dynamic Language Runtime) runs on top of the CLR (Common ... The services provided by the DLR include support for a...
Read more >What is Dynamic Language Runtime (DLR)
The DLR introduces dynamic objects to C# and Visual Basic in Visual Studio 2010 to support dynamic behavior in these languages and enable...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am using cast to object as a workaround, but where I am specifically wanting to test the type of a dynamic e.g.
FWIW the same cast would work for the OP
Not until C# supports calling extension methods from dynamic objects…