Top "Assert" questions

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

Unittest's assertEqual and iterables - only check the contents

Is there a 'decent' way in unittest to check the equality of the contents of two iterable objects? I am …

python unit-testing assert iterable
JUnit Assert with BigDecimal

I want to use assert between 2 two decimal, I use this: BigDecimal bd1 = new BigDecimal (1000); BigDecimal bd2 = new BigDecimal (1000); org.…

java junit assert bigdecimal
Making Python's `assert` throw an exception that I choose

Can I make assert throw an exception that I choose instead of AssertionError? UPDATE: I'll explain my motivation: Up to …

python exception assert
Exception Vs Assertion

What is the difference between Java exception handling and using assert conditions? It's known that Assert is of two types. …

java assert
Is using assert() in C++ bad practice?

I tend to add lots of assertions to my C++ code to make debugging easier without affecting the performance of …

c++ coding-style assert
assert() with message

I saw somewhere assert used with a message in the following way: assert(("message", condition)); This seems to work great, …

c gcc compiler-warnings assert
python assert with and without parenthesis

Here are four simple invocations of assert: >>> assert 1==2 Traceback (most recent call last): File "<stdin>", …

python assert parentheses
differences between 2 JUnit Assert classes

The JUnit framework contains 2 Assert classes (in different packages, obviously) and the methods on each appear to be very similar. …

java unit-testing junit junit4 assert
Pthread mutex assertion error

I'm encountering the following error at unpredictable times in a linux-based (arm) communications application: pthread_mutex_lock.c:82: __pthread_mutex_…

linux pthreads mutex assert glibc
Issues in Xunit.Assert.Collection - C#

I have a Class Library, it contains the following Model and Method Model: public class Employee { public int EmpId { get; …

c# unit-testing collections assert xunit