public void TestFallbackNoTemplates() { DataFormApp_Templates dataFormApp = new DataFormApp_Templates(); this.DataFormAppBase = dataFormApp; dataFormApp.dataForm.NewItemTemplate = null; dataFormApp.dataForm.EditTemplate = null; dataFormApp.dataForm.ReadOnlyTemplate = null; dataFormApp.dataForm.ItemsSource = DataClassList.GetDataClassList(1, ListOperations.All); ContentPresenter contentPresenter = null; this.AddToPanelAndWaitForLoad(); this.EnqueueCallback(() => { contentPresenter = this.GetTemplatePart <ContentPresenter>("ContentPresenter"); ButtonBase newItemButton = this.GetTemplatePart <ButtonBase>("NewItemButton"); this.ExpectCurrentItemChange(); InvokeButton(newItemButton); }); this.WaitForCurrentItemChange(); this.EnqueueCallback(() => { TextBox textBox = contentPresenter.Content as TextBox; Assert.IsNotNull(textBox); Assert.AreEqual("Direct Content", textBox.Text); Assert.AreEqual(dataFormApp.dataForm.Content, textBox); }); this.EnqueueTestComplete(); }
public void TestFallbackNoEditOrInsertTemplate() { DataFormApp_Templates dataFormApp = new DataFormApp_Templates(); this.DataFormAppBase = dataFormApp; dataFormApp.dataForm.EditTemplate = null; dataFormApp.dataForm.NewItemTemplate = null; dataFormApp.dataForm.ItemsSource = DataClassList.GetDataClassList(1, ListOperations.All); ContentPresenter contentPresenter = null; this.AddToPanelAndWaitForLoad(); this.EnqueueCallback(() => { contentPresenter = this.GetTemplatePart <ContentPresenter>("ContentPresenter"); ButtonBase editButton = this.GetTemplatePart <ButtonBase>("EditButton"); ButtonBase newItemButton = this.GetTemplatePart <ButtonBase>("NewItemButton"); TextBox textBox = contentPresenter.Content as TextBox; Assert.IsNotNull(textBox); Assert.AreEqual("Display Template", textBox.Text); Assert.IsTrue(dataFormApp.dataForm.EffectiveIsReadOnly); Assert.IsFalse(editButton.IsEnabled); Assert.IsFalse(newItemButton.IsEnabled); }); this.EnqueueTestComplete(); }
public void TestFallbackNoDisplayTemplate() { DataFormApp_Templates dataFormApp = new DataFormApp_Templates(); dataFormApp.dataForm.CurrentItem = new DataClass(); this.DataFormAppBase = dataFormApp; dataFormApp.dataForm.ReadOnlyTemplate = null; ContentPresenter contentPresenter = null; this.AddToPanelAndWaitForLoad(); this.EnqueueCallback(() => { contentPresenter = this.GetTemplatePart <ContentPresenter>("ContentPresenter"); TextBox textBox = contentPresenter.Content as TextBox; Assert.IsNotNull(textBox); Assert.AreEqual("Edit Template", textBox.Text); }); this.EnqueueTestComplete(); }
public void TestFallbackNoTemplates() { DataFormApp_Templates dataFormApp = new DataFormApp_Templates(); this.DataFormAppBase = dataFormApp; dataFormApp.dataForm.NewItemTemplate = null; dataFormApp.dataForm.EditTemplate = null; dataFormApp.dataForm.ReadOnlyTemplate = null; dataFormApp.dataForm.ItemsSource = DataClassList.GetDataClassList(1, ListOperations.All); ContentPresenter contentPresenter = null; this.AddToPanelAndWaitForLoad(); this.EnqueueCallback(() => { contentPresenter = this.GetTemplatePart<ContentPresenter>("ContentPresenter"); ButtonBase newItemButton = this.GetTemplatePart<ButtonBase>("NewItemButton"); this.ExpectCurrentItemChange(); InvokeButton(newItemButton); }); this.WaitForCurrentItemChange(); this.EnqueueCallback(() => { TextBox textBox = contentPresenter.Content as TextBox; Assert.IsNotNull(textBox); Assert.AreEqual("Direct Content", textBox.Text); Assert.AreEqual(dataFormApp.dataForm.Content, textBox); }); this.EnqueueTestComplete(); }
public void TestFallbackNoEditOrInsertTemplate() { DataFormApp_Templates dataFormApp = new DataFormApp_Templates(); this.DataFormAppBase = dataFormApp; dataFormApp.dataForm.EditTemplate = null; dataFormApp.dataForm.NewItemTemplate = null; dataFormApp.dataForm.ItemsSource = DataClassList.GetDataClassList(1, ListOperations.All); ContentPresenter contentPresenter = null; this.AddToPanelAndWaitForLoad(); this.EnqueueCallback(() => { contentPresenter = this.GetTemplatePart<ContentPresenter>("ContentPresenter"); ButtonBase editButton = this.GetTemplatePart<ButtonBase>("EditButton"); ButtonBase newItemButton = this.GetTemplatePart<ButtonBase>("NewItemButton"); TextBox textBox = contentPresenter.Content as TextBox; Assert.IsNotNull(textBox); Assert.AreEqual("Display Template", textBox.Text); Assert.IsTrue(dataFormApp.dataForm.EffectiveIsReadOnly); Assert.IsFalse(editButton.IsEnabled); Assert.IsFalse(newItemButton.IsEnabled); }); this.EnqueueTestComplete(); }
public void TestFallbackNoDisplayTemplate() { DataFormApp_Templates dataFormApp = new DataFormApp_Templates(); dataFormApp.dataForm.CurrentItem = new DataClass(); this.DataFormAppBase = dataFormApp; dataFormApp.dataForm.ReadOnlyTemplate = null; ContentPresenter contentPresenter = null; this.AddToPanelAndWaitForLoad(); this.EnqueueCallback(() => { contentPresenter = this.GetTemplatePart<ContentPresenter>("ContentPresenter"); TextBox textBox = contentPresenter.Content as TextBox; Assert.IsNotNull(textBox); Assert.AreEqual("Edit Template", textBox.Text); }); this.EnqueueTestComplete(); }