public void VerifyThatPropertiesAreSet() { var name = "name"; var shortname = "shortname"; this.ruleVerificationList.Name = name; this.ruleVerificationList.ShortName = shortname; this.ruleVerificationList.Owner = this.systemDomainOfExpertise; var hyperlink = new HyperLink(Guid.NewGuid(), this.cache, this.uri) { Content = "some content", LanguageCode = "en-UK", Uri = "http://www.rheagroup.com" }; this.ruleVerificationList.HyperLink.Add(hyperlink); var alias = new Alias(Guid.NewGuid(), this.cache, this.uri) { IsSynonym = true }; this.ruleVerificationList.Alias.Add(alias); var definition = new Definition(Guid.NewGuid(), this.cache, this.uri) { Content = "a definition" }; this.ruleVerificationList.Definition.Add(definition); var ruleVerificationListDialogViewModel = new RuleVerificationListDialogViewModel(this.ruleVerificationList, this.thingTransaction, this.session.Object, true, ThingDialogKind.Inspect, this.thingDialogNavigationService.Object, this.iterationClone, null); Assert.AreEqual(name, ruleVerificationListDialogViewModel.Name); Assert.AreEqual(shortname, ruleVerificationListDialogViewModel.ShortName); Assert.AreEqual(this.systemDomainOfExpertise, ruleVerificationListDialogViewModel.SelectedOwner); CollectionAssert.Contains(ruleVerificationListDialogViewModel.PossibleOwner, this.systemDomainOfExpertise); CollectionAssert.Contains(ruleVerificationListDialogViewModel.PossibleOwner, this.aocsDomainOfExpertise); var hyperLinkRowViewModel = ruleVerificationListDialogViewModel.HyperLink.Single(x => x.Thing == hyperlink); Assert.IsNotNull(hyperLinkRowViewModel); Assert.AreEqual("some content", hyperLinkRowViewModel.Content); var aliasRowViewModel = ruleVerificationListDialogViewModel.Alias.Single(x => x.Thing == alias); Assert.IsNotNull(aliasRowViewModel); Assert.IsTrue(aliasRowViewModel.IsSynonym); var definitionRowViewModel = ruleVerificationListDialogViewModel.Definition.Single(x => x.Thing == definition); Assert.IsNotNull(definitionRowViewModel); Assert.AreEqual("a definition", definitionRowViewModel.Content); }
public void VerifyThatNullOwnerDisablesOkCommand() { var name = "name"; var shortname = "shortname"; this.ruleVerificationList.Name = name; this.ruleVerificationList.ShortName = shortname; var ruleVerificationListDialogViewModel = new RuleVerificationListDialogViewModel(this.ruleVerificationList, this.thingTransaction, this.session.Object, true, ThingDialogKind.Inspect, this.thingDialogNavigationService.Object, this.iterationClone, null); Assert.IsFalse(ruleVerificationListDialogViewModel.OkCanExecute); Assert.IsFalse(ruleVerificationListDialogViewModel.OkCommand.CanExecute(null)); ruleVerificationListDialogViewModel.SelectedOwner = this.systemDomainOfExpertise; Assert.IsTrue(ruleVerificationListDialogViewModel.OkCanExecute); Assert.IsTrue(ruleVerificationListDialogViewModel.OkCommand.CanExecute(null)); }
public void VerifyThatDefaultConstructorIsAvailable() { var ruleVerificationListDialogViewModel = new RuleVerificationListDialogViewModel(); Assert.IsNotNull(ruleVerificationListDialogViewModel); }