示例#1
0
        public void PrepareTest()
        {
            var actionInfoRegistry = new CommandRegistry();

            actionInfoRegistry.Init(new MockPluginLoader());
            _actionInfoDiscover = new CommandRepository(actionInfoRegistry);
        }
示例#2
0
        public void Init_WithProvider_Should_Ok()
        {
            var actionInfoRegistry = new CommandRegistry();

            actionInfoRegistry.Init(new MockPluginLoader());
            actionInfoRegistry.Commands.LogJson();
            actionInfoRegistry.Commands.Count.ShouldEqual(6);
        }
示例#3
0
        public void Init_Null_Should_Throws()
        {
            var actionInfoRegistry = new CommandRegistry();

            AssertHelper.ShouldThrows <ArgumentNullException>(() =>
            {
                actionInfoRegistry.Init(null);
            });
        }
示例#4
0
        public void Init_NotInvoke_Should_Empty()
        {
            var actionInfoRegistry = new CommandRegistry();

            actionInfoRegistry.Commands.Count.ShouldEqual(0);
        }
示例#5
0
 public CommandRepository(CommandRegistry registry)
 {
     _registry = registry ?? throw new ArgumentNullException(nameof(registry));
 }