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
SplitOverloadTest.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="SplitOverloadTest.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;
12using Csla.TestHelpers;
13
14#if !NUNIT
15using Microsoft.VisualStudio.TestTools.UnitTesting;
16#else
17using NUnit.Framework;
18using TestClass = NUnit.Framework.TestFixtureAttribute;
19using TestInitialize = NUnit.Framework.SetUpAttribute;
20using TestCleanup = NUnit.Framework.TearDownAttribute;
21using TestMethod = NUnit.Framework.TestAttribute;
22#endif
23
25{
26 [TestClass]
27 public class SplitOverloadTest
28 {
29 private static TestDIContext _testDIContext;
30
32 public static void ClassInitialize(TestContext context)
33 {
34 _testDIContext = TestDIContextFactory.CreateDefaultContext();
35 }
36
37 [TestMethod]
38 public void TestDpCreate()
39 {
40 IDataPortal<SplitOverload> dataPortal = _testDIContext.CreateDataPortal<SplitOverload>();
41
42 SplitOverload test = SplitOverload.NewObject(dataPortal);
43 Assert.AreEqual("Created", TestResults.GetResult("SplitOverload"));
44 }
45 [TestMethod]
47 {
48 IDataPortal<SplitOverload> dataPortal = _testDIContext.CreateDataPortal<SplitOverload>();
49
51 Assert.AreEqual("Created1", TestResults.GetResult("SplitOverload"));
52 }
53 [TestMethod]
54 public void TestDpFetch()
55 {
56 IDataPortal<SplitOverload> dataPortal = _testDIContext.CreateDataPortal<SplitOverload>();
57
58 SplitOverload test = SplitOverload.GetObject(5, dataPortal);
59 Assert.AreEqual("Fetched", TestResults.GetResult("SplitOverload"));
60 }
61 [TestMethod]
62 public void TestDpDelete()
63 {
64 IDataPortal<SplitOverload> dataPortal = _testDIContext.CreateDataPortal<SplitOverload>();
65
66 SplitOverload.DeleteObject(5, dataPortal);
67 Assert.AreEqual("Deleted", TestResults.GetResult("SplitOverload"));
68 }
69
70 }
71}
static T GetObject(int id, IDataPortal< T > dataPortal)
static T NewObject(IDataPortal< T > dataPortal)
static T NewObjectWithCriteria(IDataPortal< T > dataPortal)
static void DeleteObject(int id, IDataPortal< T > dataPortal)
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 string GetResult(string key)
Get a result of an operation from the underlying results dictionary
Definition: TestResults.cs:49
Type to carry context information for DI in unit tests
Interface defining the members of the data portal type.
Definition: IDataPortalT.cs:17