Lecture overview -- Keyboard shortcut: 'u'  Previous page: NUnit Attributes -- Keyboard shortcut: 'p'  Next page: Unit Test Concepts  -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 26 : 35
Object-oriented Programming in C#
Test of Object-oriented Programs
NUnit Assertions

  • Assert.AreEqual(expected, actual)

    • 18 overloads. With/without message, tolerance, object params

  • Assert.AreNotEqual(expected, actual)

    • 18 overloads. With/without: message

  • Assert.AreSame(expected, actual)            references to same object?

    • 3 overloads. With/without: message, object params

  • Assert.NotSame(expected, actual)

    • 3 overloads. With/without: message, object params

  • Assert.Contains(object, anIList)

    • 3 overloads. With/without: message, object params

  • Assert.Greater(arg1, arg2)

    • 18 overloads. With/without: message, object params

  • Assert.Less(arg1, arg2)

    • 18 overloads. With/without: message, object params

  • Assert.IsInstanceOfType(Type, object)

    • 3 overloads. With/without: message, object params

  • Assert.IsNotInstanceOfType(Type, object)

    • 3 overloads. With/without: message, object params

  • Assert.IsAssignableFrom(Type, object)

    • 3 overloads. With/without: message, object params

  • Assert.IsNotAssignableFrom(Type, object)

    • 3 overloads. With/without: message, object params

  • Assert.IsTrue(aBool)

    • 3 overloads. With/without: message, object params

  • Assert.IsFalse(aBool)

    • 3 overloads. With/without: message, object params

  • Assert.IsNaN(aDouble)

    • 3 overloads. With/without: message, object params

  • Assert.IsEmpty(aString)

    • 3 overloads. With/without: message, object params

  • Assert.IsEmpty(anICollection)

    • 3 overloads. With/without: message, object params

  • Assert.IsNotEmpty(aString)

    • 3 overloads. With/without: message, object params

  • Assert.IsNotEmpty(anICollection)

    • 3 overloads. With/without: message, object params

  • Assert.Fail()

    • 3 overloads. With/without: message, object params

  • StringAssert.Contains(expectedString, actualString)

    • 3 overloads. With/without: message, object params

  • StringAssert.StartsWith(expectedString, actualString)

    • 3 overloads. With/without: message, object params

  • StringAssert.EndsWith(expectedString, actualString)

    • 3 overloads. With/without: message, object params

  • StringAssert.AreEqualIgnoringCase(expectedString, actualString)

    • 3 overloads. With/without: message, object params

Consult the NUnit documentation for the full and exact set of Assertions