2using System.Collections.Generic;
4using System.Reflection;
6using System.Threading.Tasks;
8using Microsoft.VisualStudio.TestTools.UnitTesting;
20 _testDIContext = TestDIContextFactory.CreateDefaultContext();
29 var result = dataPortal.
Fetch(1);
30 Assert.AreEqual(1, result.Id);
31 Assert.AreEqual(
"abc", result.Name);
33 result = dataPortal.
Fetch();
34 Assert.AreEqual(
int.MaxValue, result.Id);
35 Assert.AreEqual(
string.Empty, result.Name);
37 result = dataPortal.
Fetch(
new List<int?>());
40 result = dataPortal.
Fetch(
new List<DateTime?>());
45 [ExpectedException(typeof(AmbiguousMatchException),
"Should throw 'AmbiguousMatchException'")]
52 var result = dataPortal.
Fetch(1,
default(
bool?));
56 throw ex.GetBaseException();
This exception is returned for any errors occurring during the server-side DataPortal invocation.
void TestDpFetchNullable()
static void ClassInitialize(TestContext context)
Static dictionary-like class that offers similar functionality to GlobalContext This is used in tests...
static void Reinitialise()
Reinitialise the dictionary, clearing any existing results, ready for the next test
static string GetResult(string key)
Get a result of an operation from the underlying results dictionary
Type to carry context information for DI in unit tests
Interface defining the members of the data portal type.
object Fetch(params object[] criteria)
Called by a factory method in a business class to retrieve an object, which is loaded with values fro...