public void Create_ShouldCreateCircleColliderComponentPropertiesEditorViewModel_GivenCircleColliderComponentModel() { // Arrange var componentModel = new CircleColliderComponentModel(new Engine.Physics.Components.CircleColliderComponent()); // Act var viewModel = _componentPropertiesEditorViewModelFactory.Create(componentModel); // Assert Assert.That(viewModel, Is.TypeOf <CircleColliderComponentPropertiesEditorViewModel>()); }
public void Radius_ShouldUpdateCircleColliderComponentRadius() { // Arrange var circleColliderComponent = new CircleColliderComponent { Radius = 123 }; var circleColliderComponentModel = new CircleColliderComponentModel(circleColliderComponent); // Assume Assume.That(circleColliderComponentModel.Radius, Is.EqualTo(123)); // Act circleColliderComponentModel.Radius = 456; // Assert Assert.That(circleColliderComponentModel.Radius, Is.EqualTo(456)); Assert.That(circleColliderComponent.Radius, Is.EqualTo(456)); }
public void Radius_ShouldUpdateCircleColliderComponentModelRadius() { // Arrange var circleColliderComponent = new Engine.Physics.Components.CircleColliderComponent { Radius = 123 }; var circleColliderComponentModel = new CircleColliderComponentModel(circleColliderComponent); var circleColliderComponentPropertiesEditorViewModel = new CircleColliderComponentPropertiesEditorViewModel(circleColliderComponentModel); // Assume Assume.That(circleColliderComponentPropertiesEditorViewModel.Radius, Is.EqualTo(123)); // Act circleColliderComponentPropertiesEditorViewModel.Radius = 456; // Assert Assert.That(circleColliderComponentPropertiesEditorViewModel.Radius, Is.EqualTo(456)); Assert.That(circleColliderComponentModel.Radius, Is.EqualTo(456)); }
public CircleColliderComponentPropertiesEditorViewModel(CircleColliderComponentModel componentModel) : base(componentModel) { _radius = CreateProperty(nameof(Radius), componentModel.Radius); _radius.Subscribe(v => componentModel.Radius = v); }