public void InitializeCommand_Negative_Test(ICommand command, CommandSchema commandSchema, CommandInput commandInput)
        {
            // Arrange
            var initializer = new CommandInitializer();

            // Act & Assert
            initializer.Invoking(i => i.InitializeCommand(command, commandSchema, commandInput))
            .Should().ThrowExactly <CliFxException>();
        }
        public void InitializeCommand_Test(ICommand command, CommandSchema commandSchema, CommandInput commandInput,
                                           ICommand expectedCommand)
        {
            // Arrange
            var initializer = new CommandInitializer();

            // Act
            initializer.InitializeCommand(command, commandSchema, commandInput);

            // Assert
            command.Should().BeEquivalentTo(expectedCommand, o => o.RespectingRuntimeTypes());
        }
예제 #3
0
        public static void AddCommand <T, TCommand>(this ArgsMapper <T> mapper,
                                                    Expression <Func <T, TCommand> > propertySelector, string name,
                                                    Action <ArgsCommandSettings <TCommand> > commandSettings)
            where T : class
            where TCommand : class
        {
            var command = CommandInitializer.Initialize(mapper,
                                                        propertySelector, name, commandSettings);

            mapper.CommandValidationService.Validate(mapper, command);

            mapper.Commands.Add(command);
        }
        public TriangulationViewModel(Canvas canvas, IService <Region> regionService, IController controller)
        {
            this.canvas        = canvas;
            this.regionService = regionService;
            this.controller    = controller;
            region             = this.regionService.Initialize();

            algorithm        = new DelaunayAlgorithm();
            linesOnCanvas    = new ConcurrentDictionary <Edge, Line>();
            verticesOnCanvas = new ConcurrentDictionary <Vertex, Tuple <Ellipse, TextBlock> >();
            canvasHelper     = new CanvasHelper(this.canvas, CurrentZoom, verticesOnCanvas, linesOnCanvas);
            initializer      = new CommandInitializer(this);

            //this.Initialize();
            initializer.Initialize();
            NumberOfPoints = 3;
        }