public void VerifyInspectReferencedElementDefinitionCommand() { var vm = new ElementUsageDialogViewModel(this.usageClone, this.thingTransaction, this.session.Object, true, ThingDialogKind.Update, this.thingDialogNavigationService.Object, this.definition1Clone); Assert.IsTrue(vm.InspectSelectedElementDefinitionCommand.CanExecute(null)); vm.InspectSelectedElementDefinitionCommand.Execute(null); this.thingDialogNavigationService.Verify(x => x.Navigate(It.IsAny <ElementDefinition>(), It.IsAny <ThingTransaction>(), this.session.Object, false, ThingDialogKind.Inspect, this.thingDialogNavigationService.Object, It.IsAny <Thing>(), null)); }
public void VerifyThatElementDefinitionCategoriesArePopulated() { var productCategory = new Category(Guid.NewGuid(), this.cache, this.uri); this.definition2.Category.Add(productCategory); this.usageClone = this.usage.Clone(false); var vm = new ElementUsageDialogViewModel(this.usageClone, this.thingTransaction, this.session.Object, true, ThingDialogKind.Update, this.thingDialogNavigationService.Object, this.definition1Clone); Assert.That(vm.AppliedCategories.Any(x => x.Category == productCategory), Is.True); }
public void VerifyThatPropertiesAreSet() { var vm = new ElementUsageDialogViewModel(this.usageClone, this.thingTransaction, this.session.Object, true, ThingDialogKind.Update, this.thingDialogNavigationService.Object, this.definition1Clone); Assert.AreEqual(1, vm.PossibleExcludeOption.Count); Assert.AreEqual(1, vm.PossibleCategory.Count); Assert.AreEqual(1, vm.PossibleOwner.Count); vm.IncludeOption = new ReactiveList <Option>(); Assert.AreEqual(1, vm.ExcludeOption.Count); }