public void CollectionFor_ShouldThrowAUsefulExceptionForTypesThatAreNotGenericIEnumerable() { var strategy = new EnumerableBindingStrategy(); Action act = () => strategy.CollectionFor(GetType()); act.Should().Throw <InvalidOperationException>().WithMessage("Type does not implement IEnumerable<>: SimpleConfig.Tests.BindingStrategies.EnumerableBindingStrategyTests, SimpleConfig.Tests, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"); }
public void CollectionFor_GenericConcreeteTypesShouldBeSupported_EvenIfTheyAreNotSubclassesOfList(Type requested, Type expectedInstanceType) { var createdInstance = new EnumerableBindingStrategy().CollectionFor(requested); createdInstance.GetType().Should().Be(expectedInstanceType); }
public void CollectionFor_GenericInterfaceTypesShouldBeSupported(Type requested, Type expectedInstanceType) { var createdInstance = new EnumerableBindingStrategy().CollectionFor(requested); createdInstance.GetType().Should().Be(expectedInstanceType); }