Top "Assert" questions

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

Why does Assert.AreEqual(T obj1, Tobj2) fail with identical byte arrays

I have two identical byte arrays in the following segment of code: /// <summary> ///A test for Bytes ///</…

c# unit-testing assert
assert vs. JUnit Assertions

Today I saw a JUnit test case with a java assertion instead of the JUnit assertions—Are there significant advantages …

java junit assert assertions
Disable assertions in Python

How do I disable assertions in Python? That is, if an assertion fails, I don't want it to throw an …

python debugging exception-handling environment-variables assert
How to use Rhino.Mocks AssertWasCalled() correctly?

I call _mocks.ReplayAll(), then one or more _mockedObject.AssertWasCalled() and then _mocks.VerifyAll(). But it tells me that "This …

c# nunit rhino-mocks assert
Why are assertEquals() parameters in the order (expected, actual)?

Why do so many assertEquals() or similar function take the expected value as first parameter and the actual one as …

python debugging assert
Custom C++ assert macro

I stumbled upon an informative article: http://cnicholson.net/2009/02/stupid-c-tricks-adventures-in-assert/ which pointed out a great number of problems that exist …

c++ macros assert
Rails ActiveSupport: How to assert that an error is raised?

I am wanting to test a function on one of my models that throws specific errors. The function looks something …

ruby-on-rails assert activesupport raise
Should I be using assert in my PHP code?

A coworker has added the assert command a few times within our libraries in places where I would have used …

php assert
Is assert(false) ignored in release mode?

I am using VC++. Is assert(false) ignored in release mode?

c++ visual-c++ posix assert
"'assert’ was not declared in this scope" in MySQL++

I'm compiling a project in XCode where MySQL++ in included and linked to. For some reason, I keep getting the …

c++ xcode macos assert mysql++