예제 #1
0
        public void BeforeTest()
        {
            var commandMetadata = CommandMetadataHelper.GetCommandMetadata();

            this.commandMeta = new Meta <ICommand, CommandMetadata>(
                new CommandStub(),
                commandMetadata);
            this.commandFactoryMock = new Mock <CommandFactory>();
#pragma warning disable CC0031 // Check for null before calling a delegate
            this.commandFactoryMock
            .Setup(f => f("ValidGroup", "NotRegisteredCommand"))
            .Throws(new ComponentNotRegisteredException(
                        new TypedService(typeof(CommandResolverTests))));
            this.commandFactoryMock
            .Setup(f => f("ValidGroup", "CannotResolveCommand"))
            .Throws(new DependencyResolutionException("Cannot resolve command."));
            this.commandFactoryMock
            .Setup(f => f("ValidGroup", "ValidCommand"))
            .Returns(() => this.commandMeta);
#pragma warning restore CC0031 // Check for null before calling a delegate
        }
예제 #2
0
 public void BeforeTest()
 {
     this.commandMetadata = CommandMetadataHelper.GetCommandMetadata();
 }