10using Microsoft.VisualStudio.TestTools.UnitTesting;
15using TestClass = NUnit.Framework.TestFixtureAttribute;
16using TestInitialize = NUnit.Framework.SetUpAttribute;
17using TestCleanup = NUnit.Framework.TearDownAttribute;
18using TestMethod = NUnit.Framework.TestAttribute;
31 _testDIContext = TestDIContextFactory.CreateDefaultContext();
41 root.FetchChild(childDataPortal);
43 Assert.IsFalse(root.Child.IsDirty,
"Child should not be dirty");
44 Assert.AreEqual(
"Fetched", root.Child.Status,
"Child status incorrect after fetch");
48 Assert.AreEqual(
"Fetched", root.Child.Status,
"Child status incorrect after Save");
57 var root = dataPortal.Create();
58 root.FetchChild(childDataPortal);
60 Assert.IsFalse(root.Child.IsDirty,
"Child should not be dirty");
61 Assert.AreEqual(
"Fetched", root.Child.Status,
"Child status incorrect after fetch");
65 Assert.AreEqual(
"Updated", root.Child.Status,
"Child status incorrect after Save");
static void ClassInitialize(TestContext context)
void FetchAndSaveAnyChild()
void Create([Inject] IChildDataPortal< Child > childDataPortal, [Inject]IChildDataPortal< ChildList > childListDataPortal)
Type to carry context information for DI in unit tests
Interface defining the members of the child data portal type.
Interface defining the members of the data portal type.