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.
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Events
Macros
Pages
CslaClaimsPrincipalSerializationTests.cs
Go to the documentation of this file.
1
//-----------------------------------------------------------------------
2
// <copyright file="CslaClaimsPrincipalSerializationTests.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
//-----------------------------------------------------------------------
8
using
System;
9
using
System.Collections.Generic;
10
using
System.Text;
11
using
System.Linq;
12
using
System.ComponentModel;
13
using
System.Diagnostics;
14
using
Csla
.
Serialization
;
15
using
Csla
.
Test
.
ValidationRules
;
16
using
UnitDriven
;
17
using
Csla
.
TestHelpers
;
18
19
#if NUNIT
20
using
NUnit.Framework;
21
using
TestClass = NUnit.Framework.TestFixtureAttribute;
22
using
TestInitialize = NUnit.Framework.SetUpAttribute;
23
using
TestCleanup = NUnit.Framework.TearDownAttribute;
24
using
TestMethod = NUnit.Framework.TestAttribute;
25
#else
26
using
Microsoft
.VisualStudio.TestTools.UnitTesting;
27
using
Csla
.
Serialization
.
Mobile
;
28
using
System.IO;
29
#endif
30
31
namespace
Csla.Test.Serialization
32
{
33
[TestClass()]
34
public
class
CslaClaimsPrincipalSerializationTests
35
{
36
private
static
TestDIContext
_testDIContext;
37
38
[
ClassInitialize
]
39
public
static
void
ClassInitialize
(TestContext context)
40
{
41
_testDIContext = TestDIContextFactory.CreateDefaultContext();
42
}
43
44
[TestMethod]
45
public
void
SerializeCslaClaimsPrincipal
()
46
{
47
var identity =
new
System.Security.Principal.GenericIdentity(
"rocky"
,
"custom"
);
48
var principal =
new
Csla
.
Security
.
CslaClaimsPrincipal
(identity);
49
var applicationContext = _testDIContext.CreateTestApplicationContext();
50
var cloner =
new
Core.ObjectCloner(applicationContext);
51
var clone = (
Csla
.
Security
.
CslaClaimsPrincipal
)cloner.Clone(principal);
52
Assert.AreEqual(principal.Identity.Name, clone.Identity.Name);
53
Assert.AreEqual(principal.Identity.AuthenticationType, clone.Identity.AuthenticationType);
54
}
55
}
56
}
Csla.Security.CslaClaimsPrincipal
ClaimsPrincipal subclass that supports serialization by SerializationFormatterFactory....
Definition:
CslaClaimsPrincipal.cs:21
Csla.Test.Serialization.CslaClaimsPrincipalSerializationTests
Definition:
CslaClaimsPrincipalSerializationTests.cs:35
Csla.Test.Serialization.CslaClaimsPrincipalSerializationTests.ClassInitialize
static void ClassInitialize(TestContext context)
Definition:
CslaClaimsPrincipalSerializationTests.cs:39
Csla.Test.Serialization.CslaClaimsPrincipalSerializationTests.SerializeCslaClaimsPrincipal
void SerializeCslaClaimsPrincipal()
Definition:
CslaClaimsPrincipalSerializationTests.cs:45
Csla.TestHelpers.TestDIContext
Type to carry context information for DI in unit tests
Definition:
TestDIContext.cs:19
Csla.Security
Definition:
CslaClaimsPrincipal.cs:15
Csla.Serialization.Mobile
Definition:
AssemblyNameTranslator.cs:11
Csla.Serialization
Definition:
AutoNonSerializedAttribute.cs:11
Csla.Test.Serialization
Definition:
ClaimsPrincipalTests.cs:23
Csla.Test.ValidationRules
Definition:
Fakes/Server/Validation/RootThrowsException.cs:9
Csla.TestHelpers
Definition:
ApplicationContextFactory.cs:14
Csla.Test
Definition:
csla.netcore.test/Basic/BasicTests.cs:25
Csla
Definition:
BusinessRuleCases.cs:5
Microsoft
Definition:
ServiceCollectionExtensions.cs:17
UnitDriven
Definition:
Asserter.cs:13
Generated by
1.9.2