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.
CreateConstructorTests.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="CreateConstructorTests.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.ComponentModel;
10using UnitDriven;
11
12#if !NUNIT
13using Microsoft.VisualStudio.TestTools.UnitTesting;
14#else
15using NUnit.Framework;
16using TestClass = NUnit.Framework.TestFixtureAttribute;
17using TestInitialize = NUnit.Framework.SetUpAttribute;
18using TestCleanup = NUnit.Framework.TearDownAttribute;
19using TestMethod = NUnit.Framework.TestAttribute;
20#endif
21
23{
24 [TestClass]
26 {
27 [TestMethod]
29 {
30 // TODO: Not sure what the equivalent of this is in Csla 6
31 //var t1 = Csla.Reflection.MethodCaller.CreateInstance(typeof(TestClass));
32#if MSTEST
33 //Assert.IsInstanceOfType(t1, typeof(TestClass));
34#else
35 //Assert.IsInstanceOfType(typeof(TestClass), t1);
36#endif
37 }
38
39 [TestMethod]
41 {
42 // TODO: Not sure how to recreate this in Csla 6
43 //var instance = (NonPublic2)Csla.Reflection.MethodCaller.CreateInstance(typeof(NonPublic2));
44 //Assert.IsNotNull(instance);
45 }
46
47 [TestMethod]
48 [ExpectedException(typeof(InvalidOperationException))]
50 {
51 // TODO: Not sure how to do this now
52 //Csla.Reflection.MethodCaller.CreateInstance(typeof(TestStruct));
53 }
54
55 public class NonPublic1
56 {
57 protected NonPublic1() { }
58 }
59
60 private class NonPublic2
61 {
62 public NonPublic2() { }
63 }
64
65 public class TestClass
66 {
67 public TestClass() { }
68 public TestClass(int unsupported) { }
69 }
70
71 public struct TestStruct
72 {
73 }
74 }
75}