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.
IdentityConverterTests.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="IdentityConverterTests.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;
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]
28 public void ConvertObjRef()
29 {
31 object test = new object();
32 object result = conv.Convert(test, null, null, null);
33
34 Assert.IsTrue(ReferenceEquals(test, result), "Object references should be the same");
35 }
36
37 [TestMethod]
38 public void ConvertValue()
39 {
41 object result = conv.Convert(123, null, null, null);
42
43 Assert.AreEqual(123, (int)result, "Value should be 123");
44 }
45
46 [TestMethod]
47 public void ConvertBackObjRef()
48 {
50 object test = new object();
51 object result = conv.ConvertBack(test, null, null, null);
52
53 Assert.IsTrue(ReferenceEquals(test, result), "Object references should be the same");
54 }
55
56 [TestMethod]
57 public void ConvertBackValue()
58 {
60 object result = conv.ConvertBack(123, null, null, null);
61
62 Assert.AreEqual(123, (int)result, "Value should be 123");
63 }
64 }
65}
Provides the functionality of a WPF value converter without affecting the value as it flows to and fr...
object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
Returns the unchanged value.
object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
Returns the unchanged value.