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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        public void ShouldReturnScopedCommand(string scope)
        {
            var matcher = new TypeNameMatcher <IFoo>(new Type[] { FooCommandType, FooBarCommandType });

            matcher.GetMatchedType(string.Concat("foo", scope));
        }
Beispiel #4
0
        public void ShouldNotThrowWhenCommandNameMatchesCommandCompletely(string commandName)
        {
            var matcher = new TypeNameMatcher <IFoo>(new Type[] { FooCommandType, FooBarCommandType });

            Assert.Equal(FooCommandType, matcher.GetMatchedType(commandName));
        }
Beispiel #5
0
        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));
 }