9using System.Collections.Generic;
12using System.Threading.Tasks;
17using Microsoft.VisualStudio.TestTools.UnitTesting;
20using TestClass = NUnit.Framework.TestFixtureAttribute;
21using TestInitialize = NUnit.Framework.SetUpAttribute;
22using TestCleanup = NUnit.Framework.TearDownAttribute;
23using TestMethod = NUnit.Framework.TestAttribute;
36 _testDIContext = TestDIContextFactory.CreateDefaultContext();
42 var dp = _testDIContext.CreateChildDataPortal<
TestChild>();
43 var child = await dp.CreateChildAsync();
44 Assert.AreEqual(
"none", child.Name);
50 var dp = _testDIContext.CreateChildDataPortal<
TestChild>();
51 var child = await dp.CreateChildAsync(123);
52 Assert.AreEqual(
"Int32", child.Name);
58 var dp = _testDIContext.CreateChildDataPortal<
TestChild>();
59 var child = await dp.CreateChildAsync(
"abc", 123);
60 Assert.AreEqual(
"2", child.Name);
66 var dp = _testDIContext.CreateChildDataPortal<
TestChild>();
67 var child = await dp.FetchChildAsync();
68 Assert.AreEqual(
"none", child.Name);
74 var dp = _testDIContext.CreateChildDataPortal<
TestChild>();
75 var child = await dp.FetchChildAsync(123);
76 Assert.AreEqual(
"Int32", child.Name);
82 var dp = _testDIContext.CreateChildDataPortal<
TestChild>();
83 var child = await dp.FetchChildAsync(
"abc", 123);
84 Assert.AreEqual(
"2", child.Name);
90 var dp = _testDIContext.CreateChildDataPortal<
TestChild>();
91 var child = await dp.FetchChildAsync();
92 await dp.UpdateChildAsync(child,
"update", 123);
93 Assert.AreEqual(
"update/123", child.Name);
99 var dp = _testDIContext.CreateChildDataPortal<
TestChild>();
100 var child = await dp.FetchChildAsync();
102 await dp.UpdateChildAsync(child,
"deleteme", 123);
103 Assert.AreEqual(
"deleteme", child.Name);
110 var child = await dp.FetchChildAsync();
112 await dp.UpdateChildAsync(child,
"update", 123);
113 Assert.AreEqual(
"deleted", child.Name);
133 private async Task CreateChild()
141 private async Task CreateChild(
int i)
149 private async Task CreateChild(
object o)
160 private async Task CreateChild(
string s,
int i)
168 private async Task FetchChild()
176 private async Task FetchChild(
object o)
189 private async Task FetchChild(
string s,
int i)
197 private async Task UpdateChild(
string s,
int i)
204 private async Task InsertChild(params
object[] parameters)
207 Name = parameters[0].ToString();
211 private async Task DeleteChild(
string s,
int i)
234 private async Task FetchChild()
242 private void DeleteSelf()
This is the base class from which most business objects will be derived.
Maintains metadata about a property.
async Task FetchChildInt32Criteria()
async Task CreateChildMultipleCriteria()
async Task FetchChildMultipleCriteria()
async Task CreateChildInt32Criteria()
async Task DeleteSelfChildNoParamFallback()
static void ClassInitialize(TestContext context)
async Task DeleteSelfChild()
async Task FetchChildNoCriteria()
async Task CreateChildNoCriteria()
static readonly PropertyInfo< string > NameProperty
static readonly PropertyInfo< string > NameProperty
Type to carry context information for DI in unit tests
@ Serializable
Prevents updating or inserting until the transaction is complete.