public void EnsureCanAddAndDeleteWithInitialAutoEdit()
        {
            DataFormApp_FieldsWithInitialAutoEdit dataFormApp = new DataFormApp_FieldsWithInitialAutoEdit();

            this.DataFormAppBase             = dataFormApp;
            this.dataClassList               = DataClassList.GetDataClassList(5, ListOperations.All);
            dataFormApp.dataForm.CurrentItem = this.dataClassList[0];
            dataFormApp.dataForm.ItemsSource = this.dataClassList;

            this.AddToPanelAndWaitForLoad();

            this.EnqueueCallback(() =>
            {
                dataFormApp.dataForm.BeginEdit();
                Assert.IsTrue(dataFormApp.dataForm.CanAddItems);
                Assert.IsTrue(dataFormApp.dataForm.CanDeleteItems);
            });

            this.EnqueueTestComplete();
        }
        public void EnsureCancelButtonShownBeforeEditBeginsWithAutoEdit()
        {
            DataFormApp_FieldsWithInitialAutoEdit dataFormApp = new DataFormApp_FieldsWithInitialAutoEdit();
            dataFormApp.dataForm.CurrentItem = new DataClass();

            this.EnqueueCallback(() =>
            {
                this.DataFormAppBase = dataFormApp;
            });

            this.AddToPanelAndWaitForLoad();

            this.EnqueueCallback(() =>
            {
                ButtonBase cancelButton = this.GetTemplatePart<ButtonBase>("CancelButton");
                Assert.AreEqual(Visibility.Visible, cancelButton.Visibility);
            });

            this.EnqueueTestComplete();
        }
        public void EnsureCanAddAndDeleteWithInitialAutoEdit()
        {
            DataFormApp_FieldsWithInitialAutoEdit dataFormApp = new DataFormApp_FieldsWithInitialAutoEdit();
            this.DataFormAppBase = dataFormApp;
            this.dataClassList = DataClassList.GetDataClassList(5, ListOperations.All);
            dataFormApp.dataForm.CurrentItem = this.dataClassList[0];
            dataFormApp.dataForm.ItemsSource = this.dataClassList;

            this.AddToPanelAndWaitForLoad();

            this.EnqueueCallback(() =>
            {
                dataFormApp.dataForm.BeginEdit();
                Assert.IsTrue(dataFormApp.dataForm.CanAddItems);
                Assert.IsTrue(dataFormApp.dataForm.CanDeleteItems);
            });

            this.EnqueueTestComplete();
        }
        public void EnsureCanCancelEditWithInitialAutoEdit()
        {
            DataFormApp_FieldsWithInitialAutoEdit dataFormApp = new DataFormApp_FieldsWithInitialAutoEdit();
            this.DataFormAppBase = dataFormApp;
            DataClassList dataClassList = DataClassList.GetDataClassList(5, ListOperations.All);
            dataFormApp.dataForm.CurrentItem = dataClassList[0];
            dataFormApp.dataForm.ItemsSource = dataClassList;

            this.AddToPanelAndWaitForLoad();

            this.EnqueueCallback(() =>
            {
                dataFormApp.dataForm.BeginEdit();
                this.GetInputControls();
                this.textBox.Text = "new string";
                Assert.IsTrue(dataFormApp.dataForm.CanCancelEdit);
            });

            this.EnqueueTestComplete();
        }