public void FromNamespaceContaining_T_ReturnsSelfAsFilter() { var subject = new DetectTypes(); Assert.Same( subject, subject.FromNamespaceContaining<IService>()); }
public void KnownTypes_GivenFromNamespaceContainingHasBeenCalled_ReturnsTypesInAssembly() { var subject = new DetectTypes(); subject.FromNamespaceContaining<IService>(); var ns = typeof(IService).Namespace; var expectedTypes = typeof(IService).Assembly.GetTypes().Where(type => type.Namespace == ns); var knownTypes = subject.KnownTypes(); foreach (var type in expectedTypes) Assert.Contains( type, knownTypes); }