File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,24 @@ public void TypesInLibGit2SharpMustBeExtensibleInATestingContext()
108
108
}
109
109
}
110
110
111
+ [ Fact ]
112
+ public void LibGit2SharpInterfacesCoverAllPublicMembers ( )
113
+ {
114
+ var methodsMissingFromInterfaces =
115
+ from t in Assembly . GetAssembly ( typeof ( IRepository ) ) . GetExportedTypes ( )
116
+ where ! t . IsInterface
117
+ where t . GetInterfaces ( ) . Any ( i => i . Namespace == typeof ( IRepository ) . Namespace )
118
+ let interfaceTargetMethods = from i in t . GetInterfaces ( )
119
+ from im in t . GetInterfaceMap ( i ) . TargetMethods
120
+ select im
121
+ from tm in t . GetMethods ( BindingFlags . DeclaredOnly | BindingFlags . Public | BindingFlags . Instance )
122
+ where ! interfaceTargetMethods . Contains ( tm )
123
+ select t . Name + " has extra method " + tm . Name ;
124
+
125
+ Assert . Equal ( "" , string . Join ( Environment . NewLine ,
126
+ methodsMissingFromInterfaces . ToArray ( ) ) ) ;
127
+ }
128
+
111
129
[ Fact ]
112
130
public void EnumsWithFlagsHaveMutuallyExclusiveValues ( )
113
131
{
You can’t perform that action at this time.
0 commit comments