Exemple #1
0
 public void SetUp()
 {
     // Arrange
     _rectangleColliderComponent = new RectangleColliderComponent {
         Dimension = new Vector2(1, 2)
     };
     _rectangleColliderComponentModel = new RectangleColliderComponentModel(_rectangleColliderComponent);
 }
        public void SetUp()
        {
            // Arrange
            var rectangleColliderComponent = new Engine.Physics.Components.RectangleColliderComponent {
                Dimension = new Vector2(1, 2)
            };

            _rectangleColliderComponentModel = new RectangleColliderComponentModel(rectangleColliderComponent);
            _rectangleColliderComponentPropertiesEditorViewModel = new RectangleColliderComponentPropertiesEditorViewModel(_rectangleColliderComponentModel);
        }
Exemple #3
0
        public void Create_ShouldCreateRectangleColliderComponentPropertiesEditorViewModel_GivenRectangleColliderComponentModel()
        {
            // Arrange
            var componentModel = new RectangleColliderComponentModel(new Engine.Physics.Components.RectangleColliderComponent());

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

            // Assert
            Assert.That(viewModel, Is.TypeOf <RectangleColliderComponentPropertiesEditorViewModel>());
        }
 public RectangleColliderComponentPropertiesEditorViewModel(RectangleColliderComponentModel componentModel) : base(componentModel)
 {
     _dimension = CreateProperty(nameof(Dimension), componentModel.Dimension);
     _dimension.Subscribe(v => componentModel.Dimension = v);
 }