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

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

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