private static IEnumerable <IReturnValueTransformer> DiscoverDefaultReturnValueTransformers() { Discoverer discoverer = new Discoverer( new AssemblyTypeContainer(typeof(SerializableLambdaInvoker).Assembly)); return(discoverer.GetAll <IReturnValueTransformer>()); }
public void GetAll_ReturnsOnlyDefaultConstructable() { Type[] types = { typeof(NonDefaultConstructableFoo), typeof(Bar) }; _typeContainerMock.Setup(container => container.GetTypes()).Returns(types); var subject = new Discoverer(_typeContainerMock.Object); Assert.AreEqual(1, subject.GetAll<IFoo>().Count()); }
public void GetAll_OnlyReturnsImplementingTypes() { Type[] types = { typeof(Bar), typeof(string), typeof(IDisposable) }; _typeContainerMock.Setup(container => container.GetTypes()).Returns(types); var subject = new Discoverer(_typeContainerMock.Object); Assert.AreEqual(1, subject.GetAll<IFoo>().Count()); }
public void GetAll_SkipsInterfaces() { Type[] types = { typeof(IBar) }; _typeContainerMock.Setup(container => container.GetTypes()).Returns(types); var subject = new Discoverer(_typeContainerMock.Object); Assert.IsEmpty(subject.GetAll <IFoo>()); }
public void GetAll_ReturnsOnlyDefaultConstructable() { Type[] types = { typeof(NonDefaultConstructableFoo), typeof(Bar) }; _typeContainerMock.Setup(container => container.GetTypes()).Returns(types); var subject = new Discoverer(_typeContainerMock.Object); Assert.AreEqual(1, subject.GetAll <IFoo>().Count()); }
public void GetAll_OnlyReturnsImplementingTypes() { Type[] types = { typeof(Bar), typeof(string), typeof(IDisposable) }; _typeContainerMock.Setup(container => container.GetTypes()).Returns(types); var subject = new Discoverer(_typeContainerMock.Object); Assert.AreEqual(1, subject.GetAll <IFoo>().Count()); }
public void GetAll_SkipsInterfaces() { Type[] types = { typeof(IBar) }; _typeContainerMock.Setup(container => container.GetTypes()).Returns(types); var subject = new Discoverer(_typeContainerMock.Object); Assert.IsEmpty(subject.GetAll<IFoo>()); }