9using System.Configuration;
16using System.Threading.Tasks;
19using Microsoft.VisualStudio.TestTools.UnitTesting;
22using TestClass = NUnit.Framework.TestFixtureAttribute;
23using TestInitialize = NUnit.Framework.SetUpAttribute;
24using TestCleanup = NUnit.Framework.TearDownAttribute;
25using TestMethod = NUnit.Framework.TestAttribute;
41 _testDIContext = TestDIContextFactory.CreateContext(options =>
45 dp => dp.AddServerSideDataPortal(
63 #region constructor(Type authProviderType) tests
93 #region constructur(string cslaAuthorizationProvider) tests
143 #region default constructor() tests
158 #region Authorize() tests
163 var applicationContext = _testDIContext.CreateTestApplicationContext();
169 Assert.IsNotNull(result,
"AuthorizeDataPortalStub not accessible");
170 Assert.AreEqual(typeof(
TestBO), result.ClientRequest?.ObjectType);
177 var applicationContext = _testDIContext.CreateTestApplicationContext();
183 Assert.IsNotNull(result,
"AuthorizeDataPortalStub not accessible");
184 Assert.AreEqual(typeof(
TestBO), result.ClientRequest?.ObjectType);
191 var applicationContext = _testDIContext.CreateTestApplicationContext();
198 Assert.IsNotNull(result,
"AuthorizeDataPortalStub not accessible");
199 Assert.AreEqual(typeof(
TestBO), result.ClientRequest?.ObjectType);
206 var applicationContext = _testDIContext.CreateTestApplicationContext();
212 Assert.IsNotNull(result,
"AuthorizeDataPortalStub not accessible");
213 Assert.AreEqual(typeof(
TestBO), result.ClientRequest?.ObjectType);
Csla.Server.DataPortalContext DataPortalContext
DataPortal(ApplicationContext applicationContext, IDashboard dashboard, CslaOptions options, IAuthorizeDataPortal authorizer, InterceptorManager interceptors, IObjectFactoryLoader factoryLoader, IDataPortalActivator activator, IDataPortalExceptionInspector exceptionInspector, DataPortalExceptionHandler exceptionHandler)
Creates an instance of the type.
async Task< DataPortalResult > Fetch(Type objectType, object criteria, DataPortalContext context, bool isSync)
Get an existing business object.
async Task< DataPortalResult > Update(object obj, DataPortalContext context, bool isSync)
Update a business object.
async Task< DataPortalResult > Create(Type objectType, object criteria, DataPortalContext context, bool isSync)
Create a new business object.
async Task< DataPortalResult > Delete(Type objectType, object criteria, DataPortalContext context, bool isSync)
Delete a business object.
async Task DataPortal_Update_Calls_IAuthorizeDataPortal_Authorize_WithCorrectParameters()
async Task DataPortal_Fetch_Calls_IAuthorizeDataPortal_Authorize_WithCorrectParameters()
void IfAuthProviderTypeImplements_IAuthorizeDataPortal_Then_authorizerFieldShouldBeAnInstanceOfThatType()
async Task DataPortal_Delete_Calls_IAuthorizeDataPortal_Authorize_WithCorrectParameters()
async Task DataPortal_Create_Calls_IAuthorizeDataPortal_Authorize_WithCorrectParameters()
static void ClassInitialize(TestContext context)
Type to carry context information for DI in unit tests
IServiceProvider ServiceProvider
The service provider used to perform DI operations
Basically this test class exposes protected DataPortal constructor overloads to the Unit Testing Syst...
DataPortalOperations
List of data portal operations.