public void AddProperty_CanExecute_AfterSelectAvailableProperty(UniverseSources source) { var dataUniverse = new TestDataUniverse(Universe(source)); var vm = new PlanetDescriptionViewModel(dataUniverse); vm.ShowPlanetDescription(null, dataUniverse.Planets().First()); vm.SelectedAvailableProperty = vm.AvailableToAddProperties.First(); Assert.IsTrue(vm.AddProperty.CanExecute(null)); }
public void Constructor_Initialize(UniverseSources source) { var dataUniverse = new TestDataUniverse(Universe(source)); var vm = new PlanetDescriptionViewModel(dataUniverse); vm.ShowPlanetDescription(null, dataUniverse.Planets().First()); Assert.IsTrue(vm.AvailableToAddProperties.Any()); Assert.IsTrue(vm.PlanetProperties.Any()); Assert.IsNotNull(vm.AddProperty); }
public void AddProperty_AddProperty_AfterExecute(UniverseSources source) { var dataUniverse = new TestDataUniverse(Universe(source)); var vm = new PlanetDescriptionViewModel(dataUniverse); var planet = dataUniverse.Planets().First(); vm.ShowPlanetDescription(null, planet); vm.SelectedAvailableProperty = vm.AvailableToAddProperties.First(); var prop = vm.SelectedAvailableProperty.Property; vm.AddProperty.Execute(null); Assert.IsTrue(planet.Properties().Contains(prop)); }