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.
Asserter.cs
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// <copyright file="UnitTestContext.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.Threading.Tasks;
10using Microsoft.VisualStudio.TestTools.UnitTesting;
11
12namespace UnitDriven
13{
14 public class Asserter
15 {
16 public Asserter()
17 {
18 }
19
20 public void IsNull<T>(T value)
21 {
22 Assert.IsNull(value);
23 }
24
25 public void IsNotNull<T>(T value)
26 {
27 Assert.IsNotNull(value);
28 }
29
30 public void IsTrue(bool condition)
31 {
32 Assert.IsTrue(condition);
33 }
34
35 public void IsTrue(bool condition, string message)
36 {
37 Assert.IsTrue(condition, message);
38 }
39
40 public void IsFalse(bool condition)
41 {
42 Assert.IsFalse(condition);
43 }
44
45 public void IsFalse(bool condition, string message)
46 {
47 Assert.IsFalse(condition, message);
48 }
49
50 public void AreEqual<T>(T expected, T actual)
51 {
52 Assert.AreEqual(expected, actual);
53 }
54
55 public void AreEqual<T>(T expected, T actual, string message)
56 {
57 Assert.AreEqual(expected, actual, message);
58 }
59
60 public void Try(Action p)
61 {
62 p.Invoke();
63 }
64
65 public async Task Try(Func<Task> p)
66 {
67 await p();
68 }
69
70 public void Success()
71 {
72 }
73
74 }
75}
void IsNotNull< T >(T value)
Definition: Asserter.cs:25
async Task Try(Func< Task > p)
Definition: Asserter.cs:65
void IsFalse(bool condition, string message)
Definition: Asserter.cs:45
void IsFalse(bool condition)
Definition: Asserter.cs:40
void IsNull< T >(T value)
Definition: Asserter.cs:20
void IsTrue(bool condition, string message)
Definition: Asserter.cs:35
void Try(Action p)
Definition: Asserter.cs:60
void IsTrue(bool condition)
Definition: Asserter.cs:30
void AreEqual< T >(T expected, T actual)
Definition: Asserter.cs:50