Top "Assert" questions

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

Assert keyword in Java

Do you use the assert keyword or throw some validation runtime exception? What benefits does it give to you or …

java validation exception assert
Is it idiomatic Ruby to add an assert( ) method to Ruby's Kernel class?

I'm expanding my Ruby understanding by coding an equivalent of Kent Beck's xUnit in Ruby. Python (which Kent writes in) …

ruby assert xunit
Can java's assert statement allow you to specify a message?

Seems likes it might be useful to have the assert display a message when an assertion fails. Currently an AssertionError …

java assert
Using assertion in the Linux kernel

I have a question about assert() in Linux: can I use it in the kernel? If no, what techniques do …

linux linux-kernel assert assertions assertion
How does Assert.AreEqual determine equality between two generic IEnumerables?

I have a unit test to check whether a method returns the correct IEnumerable. The method builds the enumerable using …

c# unit-testing ienumerable mstest assert
Can I use assert on Android devices?

I want to use the Assert keyword in my android apps to destroy my app in some cases on the …

android assert
Ambiguous method call Both assertEquals(Object, Object) in Assert and assertEquals(double, double) in Assert match:

I am getting the following error: Both assertEquals(Object, Object) in Assert and assertEquals(double, double) in Assert match For …

java object junit double assert
How to put assert into release builds in C/C++

I need to only run ship build and I need to assert on certain condition in release build to see …

c++ c release assert
Is assert evil?

The Go language creators write: Go doesn't provide assertions. They are undeniably convenient, but our experience has been that programmers …

c++ c error-handling go assert
What are the advantages or difference in “assert False” and “self.assertFalse”

I am writing tests and I have heard some people saying to use self.assertFalse rather than assert False. Why …

python assert unit-testing