public void ShouldThrowWhenNoTypesMatches(string commandName) { var matcher = new TypeNameMatcher<IFoo>(new Type[] { FooCommandType }); var exception = Assert.Throws<ArgumentException>(() => matcher.GetMatchedType(commandName)); Assert.Equal(string.Format("The command \"{0}\" is invalid.", commandName), exception.Message); }
public void ShouldThrowWhenNoTypesMatches(string commandName) { var matcher = new TypeNameMatcher <IFoo>(new Type[] { FooCommandType }); var exception = Assert.Throws <ArgumentException>(() => matcher.GetMatchedType(commandName)); Assert.Equal(string.Format("The command \"{0}\" is invalid.", commandName), exception.Message); }
public void ShouldReturnScopedCommand(string scope) { var matcher = new TypeNameMatcher <IFoo>(new Type[] { FooCommandType, FooBarCommandType }); matcher.GetMatchedType(string.Concat("foo", scope)); }
public void ShouldNotThrowWhenCommandNameMatchesCommandCompletely(string commandName) { var matcher = new TypeNameMatcher <IFoo>(new Type[] { FooCommandType, FooBarCommandType }); Assert.Equal(FooCommandType, matcher.GetMatchedType(commandName)); }
public void ShouldGetTypeStartingWithCommandName(string commandName) { var matcher = new TypeNameMatcher <IFoo>(new Type[] { FooCommandType }); Assert.Equal(FooCommandType, matcher.GetMatchedType(commandName)); }
public void ShouldReturnScopedCommand(string scope) { var matcher = new TypeNameMatcher<IFoo>(new Type[] { FooCommandType, FooBarCommandType }); matcher.GetMatchedType(string.Concat("foo", scope)); }
public void ShouldNotThrowWhenCommandNameMatchesCommandCompletely(string commandName) { var matcher = new TypeNameMatcher<IFoo>(new Type[] { FooCommandType, FooBarCommandType }); Assert.Equal(FooCommandType, matcher.GetMatchedType(commandName)); }
public void ShouldGetTypeStartingWithCommandName(string commandName) { var matcher = new TypeNameMatcher<IFoo>(new Type[] { FooCommandType }); Assert.Equal(FooCommandType, matcher.GetMatchedType(commandName)); }