Created
September 30, 2010 12:04
-
-
Save joshrobb/604468 to your computer and use it in GitHub Desktop.
This file contains 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<>).GetGenericTypeDefinition().GetInterfaces(); | |
Because of =()=> //nothing | |
It the_useful_interface_is_extracted =()=> | |
_interfaces.ShouldContain( typeof(IUseful<>).GetGenericTypeDefinition() ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment