Exemple #1
0
        public void Create_ShouldCreateRectangleRendererComponentPropertiesEditorViewModel_GivenRectangleRendererComponentModel()
        {
            // Arrange
            var componentModel = new RectangleRendererComponentModel(new Engine.Rendering.Components.RectangleRendererComponent());

            // Act
            var viewModel = _componentPropertiesEditorViewModelFactory.Create(componentModel);

            // Assert
            Assert.That(viewModel, Is.TypeOf <RectangleRendererComponentPropertiesEditorViewModel>());
        }
Exemple #2
0
 public void SetUp()
 {
     // Arrange
     _rectangleRendererComponent = new RectangleRendererComponent
     {
         Dimension        = new Vector2(1, 2),
         Color            = Color.FromArgb(1, 2, 3, 4),
         FillInterior     = true,
         Visible          = true,
         SortingLayerName = "Test Layer",
         OrderInLayer     = 1
     };
     _rectangleRendererComponentModel = new RectangleRendererComponentModel(_rectangleRendererComponent);
 }
Exemple #3
0
        public void SetUp()
        {
            // Arrange
            var rectangleRendererComponent = new Engine.Rendering.Components.RectangleRendererComponent
            {
                Dimension        = new Vector2(1, 2),
                Color            = Color.FromArgb(1, 2, 3, 4),
                FillInterior     = true,
                Visible          = true,
                SortingLayerName = "Test Layer",
                OrderInLayer     = 1
            };

            _rectangleRendererComponentModel = new RectangleRendererComponentModel(rectangleRendererComponent);
            _rectangleRendererComponentPropertiesEditorViewModel = new RectangleRendererComponentPropertiesEditorViewModel(_rectangleRendererComponentModel);
        }
        public RectangleRendererComponentPropertiesEditorViewModel(RectangleRendererComponentModel componentModel) : base(componentModel)
        {
            _dimension        = CreateProperty(nameof(Dimension), componentModel.Dimension);
            _color            = CreateProperty(nameof(Color), componentModel.Color);
            _fillInterior     = CreateProperty(nameof(FillInterior), componentModel.FillInterior);
            _visible          = CreateProperty(nameof(Visible), componentModel.Visible);
            _sortingLayerName = CreateProperty(nameof(SortingLayerName), componentModel.SortingLayerName);
            _orderInLayer     = CreateProperty(nameof(OrderInLayer), componentModel.OrderInLayer);

            _dimension.Subscribe(v => componentModel.Dimension               = v);
            _color.Subscribe(v => componentModel.Color                       = v);
            _fillInterior.Subscribe(v => componentModel.FillInterior         = v);
            _visible.Subscribe(v => componentModel.Visible                   = v);
            _sortingLayerName.Subscribe(v => componentModel.SortingLayerName = v);
            _orderInLayer.Subscribe(v => componentModel.OrderInLayer         = v);
        }