public void VerifyThatExecuteOkOnNotRootWork() { var testdialog = new TestDialogViewModel(this.person, this.transaction, this.session.Object, false, ThingDialogKind.Create, this.navigation.Object, this.clone); testdialog.OkCommand.Execute(null); this.session.Verify(x => x.Write(It.IsAny <OperationContainer>()), Times.Never); }
public void VerifThatCopyUriCommandWorks() { var testdialog = new TestDialogViewModel(this.person, this.transaction, this.session.Object, true, ThingDialogKind.Update, this.navigation.Object, this.clone); testdialog.CopyUriCommand.Execute(true); Assert.AreEqual(testdialog.ThingUri, Clipboard.GetText()); }
public void VerifThatJsonExportCommandsWork() { var testdialog = new TestDialogViewModel(this.person, this.transaction, this.session.Object, true, ThingDialogKind.Update, this.navigation.Object, this.clone); testdialog.ShallowExportCommand.Execute(true); Assert.IsTrue(Clipboard.GetText().Contains(this.personId)); testdialog.DeepExportCommand.Execute(true); Assert.IsTrue(Clipboard.GetText().Contains(this.personId)); }
public void VerifyThatExecuteCancelWork() { var testdialog = new TestDialogViewModel(this.person, this.transaction, this.session.Object, false, ThingDialogKind.Create, this.navigation.Object, this.clone); testdialog.CancelCommand.Execute(null); Assert.IsFalse(testdialog.DialogResult.Value); Assert.AreEqual(1, this.transaction.UpdatedThing.Count); Assert.AreEqual(0, this.transaction.AddedThing.Count()); Assert.AreEqual(0, this.transaction.DeletedThing.Count()); }
public void VerifyThatIfContainmentIsNotSetThingUriContainsErrorMessage() { var guid = Guid.Parse("e7443063-a51f-49ba-8add-c3f296a24636"); var otherPerson = new Person(guid, this.cache, this.uri); var testdialog = new TestDialogViewModel(otherPerson, this.transaction, this.session.Object, true, ThingDialogKind.Inspect, this.navigation.Object, this.clone); var expectedMessage = "The container of Person with iid e7443063-a51f-49ba-8add-c3f296a24636 is null, the route cannot be computed."; Assert.AreEqual(expectedMessage, testdialog.ThingUri); }
public void VerifyThatExecuteCreateWorksOnCancel() { this.navigation.Setup( x => x.Navigate(It.IsAny <Thing>(), It.IsAny <IThingTransaction>(), It.IsAny <ISession>(), It.IsAny <bool>(), It.IsAny <ThingDialogKind>(), this.navigation.Object, It.IsAny <Thing>(), It.IsAny <IEnumerable <Thing> >())).Returns(false); var testdialog = new TestDialogViewModel(this.person, this.transaction, this.session.Object, false, ThingDialogKind.Create, this.navigation.Object, this.clone); testdialog.CreateCommand.Execute(null); this.navigation.Verify(x => x.Navigate(It.IsAny <Thing>(), It.IsAny <IThingTransaction>(), It.IsAny <ISession>(), It.IsAny <bool>(), It.IsAny <ThingDialogKind>(), this.navigation.Object, It.IsAny <Thing>(), It.IsAny <IEnumerable <Thing> >())); Assert.IsFalse(testdialog.PopulateCalled); }
public void VerifyThatCanExecuteOkCommandWorks() { // test the validation binding OkCanExecute var testdialog = new TestDialogViewModel(this.person, this.transaction, this.session.Object, false, ThingDialogKind.Create, this.navigation.Object, this.clone); testdialog.Name = ""; Assert.That(testdialog["Name"], Is.Not.Null.Or.Not.Empty); Assert.IsFalse(testdialog.OkCommand.CanExecute(null)); testdialog.Name = "ara"; Assert.That(testdialog["Name"], Is.Null.Or.Empty); Assert.IsTrue(testdialog.OkCommand.CanExecute(null)); }
public void VeriufyThatMoveUpDownWorks() { var testdialog = new TestDialogViewModel(this.person, this.transaction, this.session.Object, false, ThingDialogKind.Create, this.navigation.Object, this.clone); var row1 = new OrderedRow(new Person(Guid.Empty, null, null), this.session.Object); var row2 = new OrderedRow(new Person(Guid.Empty, null, null), this.session.Object); var row3 = new OrderedRow(new Person(Guid.Empty, null, null), this.session.Object); var row4 = new OrderedRow(new Person(Guid.Empty, null, null), this.session.Object); testdialog.OrderedRows.Add(row1); testdialog.OrderedRows.Add(row2); testdialog.OrderedRows.Add(row3); testdialog.OrderedRows.Add(row4); testdialog.MoveDown(row1); Assert.AreSame(row2, testdialog.OrderedRows[0]); Assert.AreSame(row1, testdialog.OrderedRows[1]); Assert.AreSame(row3, testdialog.OrderedRows[2]); Assert.AreSame(row4, testdialog.OrderedRows[3]); testdialog.MoveDown(row1); testdialog.MoveDown(row1); Assert.AreSame(row2, testdialog.OrderedRows[0]); Assert.AreSame(row3, testdialog.OrderedRows[1]); Assert.AreSame(row4, testdialog.OrderedRows[2]); Assert.AreSame(row1, testdialog.OrderedRows[3]); testdialog.MoveUp(row4); testdialog.MoveUp(row4); Assert.AreSame(row4, testdialog.OrderedRows[0]); Assert.AreSame(row2, testdialog.OrderedRows[1]); Assert.AreSame(row3, testdialog.OrderedRows[2]); Assert.AreSame(row1, testdialog.OrderedRows[3]); }
public void VerifyThatIfSpellDictionaryCultureIsChangedThatSpellChekerLanguageIsUpdated() { var testdialog = new TestDialogViewModel(this.person, this.transaction, this.session.Object, false, ThingDialogKind.Create, this.navigation.Object, this.clone); Assert.IsNotNull(testdialog.SpellChecker); }
public void VerifThatThingUriReturnsExpectedResult2() { var testdialog = new TestDialogViewModel(this.person, this.transaction, this.session.Object, true, ThingDialogKind.Create, this.navigation.Object, this.clone); Assert.AreEqual("N/A", testdialog.ThingUri); }
public void VerifThatThingUriReturnsExpectedResult() { var testdialog = new TestDialogViewModel(this.person, this.transaction, this.session.Object, true, ThingDialogKind.Update, this.navigation.Object, this.clone); Assert.AreEqual("http://www.rheagroup.com:80/SiteDirectory/609d5d8f-f209-4905-967e-796970fefd84/person/f1cbaf64-afa6-4467-97e5-5d98803f2848", testdialog.ThingUri); }