Top "Assert" questions

An assertion is a statement, which aborts a program when it evaluates to false.

Diff between Assert.AreEqual and Assert.AreSame?

What is the difference between Assert.AreEqual and Assert.AreSame?

c# assert
Unit Testing: Assert that a file/path exists

I am attempting to create a regression test for my Installer. The regression test is a script written in Python. …

python unit-testing assert
Usage of Assert.Inconclusive

I'm wondering how someone should use Assert.Inconclusive(). I'm using it if my unit test would be about to fail …

.net mocking tdd assert stub
Ways to ASSERT expressions at build time in C

I'm tidying up some older code that uses 'magic numbers' all over the place to set hardware registers, and I …

c refactoring assert static-assert
Verifying ArgumentException and its message in Nunit , C#

In my test program in Nunit, I want to verify that it's getting the write Argument Exception by verifying the …

c# exception nunit assert
Assert that two java beans are equivalent

This question is close, but still not what I want. I'd like to assert in a generic way that two …

java unit-testing assert javabeans equality
javax.annotation.Nonnull vs assert

I'm using Findbugs and javax.annotation.Nonnull on method parameters. On private methods I usually add an assert line to …

java assert findbugs null-check
What is the difference between assert and static_assert?

I know that static_assert makes assertions at compile time, and assert - at run time, but what is the …

c++ assert
How to check if method has an attribute

I have an example class public class MyClass{ ActionResult Method1(){ .... } [Authorize] ActionResult Method2(){ .... } [Authorize] ActionResult Method3(int value){ .... } } Now what …

c# reflection attributes tdd assert
Best practice for debug Asserts during Unit testing

Does heavy use of unit tests discourage the use of debug asserts? It seems like a debug assert firing in …

unit-testing assert