Top "Assertions" questions

An assertion is a software construct where the developer states ("asserts") a condition that he believes will always be true.

How to implement XUnit descriptive Assert message?

Context in XUnit github I found this: Add Assert.Equal(expected, actual, message) overload #350 (so a developer ask for a …

c# unit-testing xunit assertions xunit2
Asserting that a method is called exactly one time

I want to assert that a method is called exactly one time. I'm using RhinoMocks 3.5. Here's what I thought would …

tdd mocking rhino-mocks assertions
Why should I use asserts?

I never got the idea of asserts -- why should you ever use them? I mean, let's say I were …

c++ performance assertions
Enabling assertions in Netbeans

I wanna do something like java -enableassertions com.geeksanonymous.TestClass How do I do this?

java netbeans assertions
Avoiding unused variables warnings when using assert() in a Release build

Sometimes a local variable is used for the sole purpose of checking it in an assert(), like so - int …

c++ warnings assertions
Debug.Assert vs Exception Throwing

I've read plenty of articles (and a couple of other similar questions that were posted on StackOverflow) about how and …

c# exception assertions
Assert that a var is a non-empty string of no particular characters in phpunit

I want to assert that a variable is a (non-blank) string in phpunit, but I don't want to assert that …

php unit-testing phpunit assertions
Why Q_ASSERT instead of assert

In Qt there is a Q_ASSERT macro. What's the advantage of using this instead of assert from <cassert&…

qt assert assertions
Writing robust and "modern" Fortran code

In some scientific environments, you often cannot go without FORTRAN as most of the developers only know that idiom, and …

oop fortran assertions scientific-computing fortran90
protractor- difference between toBe(truth) and toBeTruthy()

as the title says- is there a difference between (for example) expect(element).isDisplayed().toBeTruthy(); and expect(element).isDisplayed().toBe(…

protractor assertions angularjs-e2e