9using System.Collections.Generic;
13using System.Diagnostics;
17using TestClass = NUnit.Framework.TestFixtureAttribute;
18using TestInitialize = NUnit.Framework.SetUpAttribute;
19using TestCleanup = NUnit.Framework.TearDownAttribute;
20using TestMethod = NUnit.Framework.TestAttribute;
22using Microsoft.VisualStudio.TestTools.UnitTesting;
36 [TestCategory(
"SkipWhenLiveUnitTesting")]
46 Assert.IsFalse(personForm.readWriteAuthorization1.GetApplyAuthorization(personForm.firstNameTextBox));
47 Assert.IsFalse(personForm.readWriteAuthorization1.GetApplyAuthorization(personForm.middleNameTextBox));
48 Assert.IsFalse(personForm.readWriteAuthorization1.GetApplyAuthorization(personForm.lastNameTextBox));
50 personForm.readWriteAuthorization1.SetApplyAuthorization(personForm.firstNameTextBox,
true);
51 personForm.readWriteAuthorization1.SetApplyAuthorization(personForm.middleNameTextBox,
true);
52 personForm.readWriteAuthorization1.SetApplyAuthorization(personForm.lastNameTextBox,
true);
54 Assert.IsTrue(personForm.readWriteAuthorization1.GetApplyAuthorization(personForm.firstNameTextBox),
56 Assert.IsTrue(personForm.readWriteAuthorization1.GetApplyAuthorization(personForm.middleNameTextBox),
58 Assert.IsTrue(personForm.readWriteAuthorization1.GetApplyAuthorization(personForm.lastNameTextBox),
62 Assert.IsFalse(personForm.firstNameTextBox.ReadOnly,
"firstname initial readonly false");
66 personForm.BindUI(personRoot);
73 Assert.IsTrue(personForm.firstNameTextBox.ReadOnly,
"Control set to readonly");
74 Assert.IsTrue(String.IsNullOrEmpty(personForm.firstNameTextBox.Text),
"Not allowed to get value");
77 personRoot.AuthLevel = 1;
80 Assert.IsTrue(personForm.firstNameTextBox.ReadOnly,
"Control set to readonly");
81 Assert.AreEqual(personRoot.FirstName, personForm.firstNameTextBox.Text,
"display text value from BO");
83 personRoot.AuthLevel = 2;
86 Assert.IsFalse(personForm.firstNameTextBox.ReadOnly,
"Control no longer readonly");
87 Assert.AreEqual(personRoot.FirstName, personForm.firstNameTextBox.Text,
"display text value from BO");
Provides consistent context information between the client and server DataPortal objects.
void Clear()
Clears all context collections.
static readonly PropertyInfo< string > FirstNameProperty
static EditablePerson GetEditablePerson()