var hub = new EnterpriseHub(
collection
);
var clients = Substitute.For<IHubCallerConnectionContext<dynamic>>();
dynamic all = new ExpandoObject();
all.LogActivity = new Action<EventMessage>(x =>
{
//noop
});
clients.Group(Arg.Any<string>())
.Returns((ExpandoObject)all);
hub.Clients = clients;
So it turns out I’m probably shooting myself in the foot with my approach, my mock doesn’t need to be a generic type of `dynamic`, it can be anything, it’s just SignalR that (later) exposes it as `dynamic`.
I changed this:
var clients = Substitute.For<IHubCallerConnectionContext<dynamic>>();
To this:
var clients = Substitute.For<IHubCallerConnectionContext<ExpandoObject>>();
And it works fine.
--
You received this message because you are subscribed to the Google Groups "NSubstitute" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
nsubstitute...@googlegroups.com.
To post to this group, send email to
nsubs...@googlegroups.com.
Visit this group at http://groups.google.com/group/nsubstitute.
For more options, visit https://groups.google.com/d/optout.