CSLA.NET 6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
AppDomainTests.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="AppDomainTests.cs" company="Marimer LLC">
3// Copyright (c) Marimer LLC. All rights reserved.
4// Website: https://cslanet.com
5// </copyright>
6// <summary>no summary</summary>
7//-----------------------------------------------------------------------
8using System;
9using System.Collections.Generic;
10using System.Text;
11using Csla.TestHelpers;
12
13#if !NUNIT
14using Microsoft.VisualStudio.TestTools.UnitTesting;
15#else
16using NUnit.Framework;
17using TestClass = NUnit.Framework.TestFixtureAttribute;
18using TestInitialize = NUnit.Framework.SetUpAttribute;
19using TestCleanup = NUnit.Framework.TearDownAttribute;
20using TestMethod = NUnit.Framework.TestAttribute;
21#endif
22
24{
25 [TestClass]
26 public class AppDomainTestClass
27 {
28 private static TestDIContext _testDIContext;
29
31 public static void ClassInitialize(TestContext context)
32 {
33 _testDIContext = TestDIContextFactory.CreateDefaultContext();
34 }
35
36 [TestMethod]
38 {
39 IDataPortal<Basic.Root> dataPortal = _testDIContext.CreateDataPortal<Basic.Root>();
40
42 int local = AppDomain.CurrentDomain.Id;
43 Basic.Root r = dataPortal.Create(new Basic.Root.Criteria());
44 int remote = r.CreatedDomain;
45
46 if (System.Configuration.ConfigurationManager.AppSettings["CslaDataPortalProxy"] == null)
47 Assert.AreEqual(local, remote, "Local and Remote AppDomains should be the same");
48 else
49 Assert.IsFalse((local == remote), "Local and Remote AppDomains should be different");
50
51 }
52
53 [TestCleanup]
55 {
57 }
58 }
59}
static void ClassInitialize(TestContext context)
Static dictionary-like class that offers similar functionality to GlobalContext This is used in tests...
Definition: TestResults.cs:21
static void Reinitialise()
Reinitialise the dictionary, clearing any existing results, ready for the next test
Definition: TestResults.cs:69
Type to carry context information for DI in unit tests
Interface defining the members of the data portal type.
Definition: IDataPortalT.cs:17