Created
September 30, 2010 19:20
-
-
Save bittercoder/605152 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class Thing | |
{ | |
} | |
public interface IMarker {} | |
public interface IUseful<T> : IMarker where T : Thing | |
{ | |
T DoSomething(); | |
} | |
public class Useful<T> : IUseful<T> where T : Thing | |
{ | |
T DoSomething() | |
{ | |
// ... | |
} | |
} | |
public class When_extracting_non_marker_interfaces | |
{ | |
static Type[] _interfaces; | |
Establish context =()=> | |
_interfaces = typeof(Useful<>).GetInterfaces() | |
.Where(i=>i.IsGenericType) | |
.Select(i=>i.GetGenericTypeDefinition()); | |
Because of =()=> | |
// What goes here to make the following assertion pass? | |
It the_useful_interface_is_extracted =()=> | |
_interfaces.ShouldContain( typeof(IUseful<>) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment