Add project files.
This commit is contained in:
36
TestingLib/Assert.cs
Normal file
36
TestingLib/Assert.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace TestingLib
|
||||
{
|
||||
public class Assert
|
||||
{
|
||||
public static ObservableCollection<UnitTestInfo> TestResults { get; set; }
|
||||
|
||||
static Assert()
|
||||
{
|
||||
TestResults = new ObservableCollection<UnitTestInfo>();
|
||||
}
|
||||
public static void AreEqual(object first,
|
||||
object second,
|
||||
string message,
|
||||
[CallerMemberName] string methodName = null)
|
||||
{
|
||||
var testInfo = new UnitTestInfo();
|
||||
if (first.Equals(second))
|
||||
{
|
||||
testInfo.DidTestPass = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
testInfo.DidTestPass = false;
|
||||
testInfo.TestFailureMessage = message;
|
||||
}
|
||||
testInfo.MethodName = methodName;
|
||||
TestResults.Add(testInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user