On behalf of James Foster:
I came across the same issue with the tutorial (currently working
through it).
I don't think this is actually testing what it says it's testing.
> var controllersWithWrongName =
InstallerTestHelper.GetHandlersFor(typeof(IController), container)
> .Where(c => c.ComponentModel.Services.Any(s => s !=
c.ComponentModel.Implementation))
> .ToArray();
> Assert.Empty(controllersWithWrongName);
all you're saying here is that the ComponentModel.Services doesn't
contain a type that isn't the Implementation.
you're NOT saying that the ComponentModel.Services actually contains
the Implementation. This test passes even if the Services list is
empty.
I think to be correct it would be something like the following...
var controllersWithWrongName =
InstallerTestHelper.GetHandlersFor(typeof(IController), container)
.Where(c => !
c.ComponentModel.Services.
SequenceEquals(new []
{c.ComponentModel.Implementation}))
.ToArray();
Assert.Empty(controllersWithWrongName);
in english: "where the ComponentModel.Services does not equal the list
containing only the Implementation"
Cheers
James
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/castle-project-users/-/09mFltJBIUwJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.