PeanutButter
Loading...
Searching...
No Matches
PeanutButter.TestUtils.Generic.PropertyAssert Class Reference

Provides a wrapper around DeepEqualityTester and NUnit for property assertions. More...

Static Public Member Functions

static void AreDeepEqual (object obj1, object obj2, params string[] ignorePropertiesByName)
 Assert that all the properties for two objects match, deep-tested. Essentially tests that all primitive properties are equal and complex ones match shape.
static void AreIntersectionEqual (object obj1, object obj2, params string[] ignorePropertiesByName)
 Assert that common (intersecting) the properties for two objects match, deep-tested. Essentially tests that all primitive properties are equal and complex ones match shape.
static void AreEqual (object obj1, object obj2, string obj1PropertyName, string obj2PropertyName=null)
 Asserts that two objects have the same value for two specified properties, by name. If the second name is omitted, it is assumed to test the same-named property on both.
static void AreNotEqual< T1, T2 > (T1 obj1, T2 obj2, string obj1PropertyName, string obj2PropertyName=null)
 Asserts that two objects have different values for two specified properties, by name. If the second name is omitted, it is assumed to test the same-named property on both.

Detailed Description

Provides a wrapper around DeepEqualityTester and NUnit for property assertions.

Member Function Documentation

◆ AreDeepEqual()

void PeanutButter.TestUtils.Generic.PropertyAssert.AreDeepEqual ( object obj1,
object obj2,
params string[] ignorePropertiesByName )
static

Assert that all the properties for two objects match, deep-tested. Essentially tests that all primitive properties are equal and complex ones match shape.

Parameters
obj1Primary object
obj2Object to compare with
ignorePropertiesByNameProperties to ignore, by name

◆ AreEqual()

void PeanutButter.TestUtils.Generic.PropertyAssert.AreEqual ( object obj1,
object obj2,
string obj1PropertyName,
string obj2PropertyName = null )
static

Asserts that two objects have the same value for two specified properties, by name. If the second name is omitted, it is assumed to test the same-named property on both.

Parameters
obj1Primary object to test
obj2Comparison object to test
obj1PropertyNameProperty to test on both objects, unless obj2PropertyName is specified
obj2PropertyNameSpecifies the name of the property to test on obj2

◆ AreIntersectionEqual()

void PeanutButter.TestUtils.Generic.PropertyAssert.AreIntersectionEqual ( object obj1,
object obj2,
params string[] ignorePropertiesByName )
static

Assert that common (intersecting) the properties for two objects match, deep-tested. Essentially tests that all primitive properties are equal and complex ones match shape.

Parameters
obj1
obj2
ignorePropertiesByName

◆ AreNotEqual< T1, T2 >()

void PeanutButter.TestUtils.Generic.PropertyAssert.AreNotEqual< T1, T2 > ( T1 obj1,
T2 obj2,
string obj1PropertyName,
string obj2PropertyName = null )
static

Asserts that two objects have different values for two specified properties, by name. If the second name is omitted, it is assumed to test the same-named property on both.

Parameters
obj1Primary object to test
obj2Comparison object to test
obj1PropertyNameProperty to test on both objects, unless obj2PropertyName is specified
obj2PropertyNameSpecifies the name of the property to test on obj2

The documentation for this class was generated from the following file:
  • source/TestUtils/PeanutButter.TestUtils.Generic/PropertyAssert.cs