Support for assertions on dynamic expressions

Bug #1073757 reported by Simone Busoli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit Framework
Triaged
Wishlist
Unassigned

Bug Description

From: https://answers.launchpad.net/nunit-3.0/+question/170909

<quote>
I have an nUnit test case that asserts the dynamic that was returned from Facebook C# SDK. Is there any way how to assert it using NUnit fluent syntax. Here is very *simplified* example for what I'm looking for:

// not working
var client = new FacebookClient(accessToken);
dynamic userInfo = client.Get("me");
Assert.That(userInfo, Is.Not.Null);
Assert.That(userInfo, Has.Property("id").Not.Null);
Assert.That(userInfo, Has.Property("name").Not.Null);

Right now I can only test by specifying 'properties' directly

// working, but not fluent
var client = new FacebookClient(accessToken);
dynamic userInfo = client.Get("me");
Assert.That(userInfo, Is.Not.Null);
Assert.That(userInfo.id, Is.Not.Null);
Assert.That(userInfo.name, Is.Not.Null);
</quote>

The request pertains member discovery of dynamic expressions, but we should consider whether the support should be limited to it or extended to other types of assertions which may now not work yet.

Changed in nunit-3.0:
status: New → Triaged
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.