public void VerifyInspectMappingToReferenceScale() { var vm = this.viewmodel; Assert.IsNull(vm.SelectedMappingToReferenceScale); var mtrs = new MappingToReferenceScale(Guid.NewGuid(), null, null); var mtrsr = new MappingToReferenceScaleRowViewModel(mtrs, this.session.Object, null); vm.MappingToReferenceScale.Add(mtrsr); vm.SelectedMappingToReferenceScale = vm.MappingToReferenceScale.First(); Assert.IsTrue(vm.InspectMappingToReferenceScaleCommand.CanExecute(null)); vm.InspectMappingToReferenceScaleCommand.Execute(null); this.navigation.Verify(x => x.Navigate(It.IsAny <MappingToReferenceScale>(), It.IsAny <ThingTransaction>(), this.session.Object, false, ThingDialogKind.Inspect, this.navigation.Object, It.IsAny <Thing>(), null)); }
public void VerifMappingToReferenceScaleCommands() { Assert.IsTrue(this.viewmodel.CreateMappingToReferenceScaleCommand.CanExecute(null)); Assert.IsFalse(this.viewmodel.InspectMappingToReferenceScaleCommand.CanExecute(null)); Assert.IsFalse(this.viewmodel.EditMappingToReferenceScaleCommand.CanExecute(null)); Assert.IsFalse(this.viewmodel.DeleteMappingToReferenceScaleCommand.CanExecute(null)); var mtrs = new MappingToReferenceScale(Guid.NewGuid(), null, null); var mtrsr = new MappingToReferenceScaleRowViewModel(mtrs, this.session.Object, null); this.viewmodel.MappingToReferenceScale.Add(mtrsr); this.viewmodel.SelectedMappingToReferenceScale = this.viewmodel.MappingToReferenceScale.First(); Assert.IsTrue(this.viewmodel.InspectMappingToReferenceScaleCommand.CanExecute(null)); Assert.IsTrue(this.viewmodel.EditMappingToReferenceScaleCommand.CanExecute(null)); Assert.IsTrue(this.viewmodel.DeleteMappingToReferenceScaleCommand.CanExecute(null)); this.viewmodel.ValueDefinition.Clear(); Assert.IsFalse(this.viewmodel.CreateMappingToReferenceScaleCommand.CanExecute(null)); }
public void VerifyReactiveCommandsCanExecuteOnInspectMode() { var vm = new BasicRdl.ViewModels.CyclicRatioScaleDialogViewModel(this.cyclicRatioScale, this.transaction, this.session.Object, true, ThingDialogKind.Inspect, this.navigation.Object, this.rdl, null); Assert.IsFalse(vm.CreateAliasCommand.CanExecute(null)); Assert.IsFalse(vm.CreateDefinitionCommand.CanExecute(null)); Assert.IsFalse(vm.CreateHyperLinkCommand.CanExecute(null)); Assert.IsFalse(vm.CreateMappingToReferenceScaleCommand.CanExecute(null)); Assert.IsFalse(vm.CreateValueDefinitionCommand.CanExecute(null)); vm.SelectedValueDefinition = this.viewmodel.ValueDefinition.First(); var mtrs = new MappingToReferenceScale(Guid.NewGuid(), null, null); var mtrsr = new MappingToReferenceScaleRowViewModel(mtrs, this.session.Object, null); vm.SelectedMappingToReferenceScale = mtrsr; Assert.IsTrue(vm.InspectValueDefinitionCommand.CanExecute(null)); Assert.IsFalse(vm.EditValueDefinitionCommand.CanExecute(null)); Assert.IsFalse(vm.DeleteValueDefinitionCommand.CanExecute(null)); Assert.IsTrue(vm.InspectMappingToReferenceScaleCommand.CanExecute(null)); Assert.IsFalse(vm.EditMappingToReferenceScaleCommand.CanExecute(null)); Assert.IsFalse(vm.DeleteMappingToReferenceScaleCommand.CanExecute(null)); }