Questions tagged [expected-exception]
90 questions
0
votes
1 answer
How to assert Errors instead of Exception in phpunit?
In my unit test I want to caught if an ArithmeticError has been thrown, just like for an Exception using the @expectedException tag.
Unfortunally, it seems that phpunit recognize only Exceptions and not Errors.
Anyone know how to test for expected…

Marco Consiglio
- 133
- 2
- 7
0
votes
1 answer
dragonframe closes unexpectedly after few seconds
the software closes after a couple of seconds, after starting it.
can anyone understand the reason?
Process: Dragonframe [777]
Path: /Applications/Dragonframe/Dragonframe.app/Contents/MacOS/Dragonframe
Identifier: com.dzed.Dragonframe
Version: 3.6.1…

nicovon
- 7
- 7
0
votes
2 answers
Method call expected when writing an array
public class test {
public static void main(String[] args) {
double[] d=new double[500];
for (int i = 0; i <500 ; i++) {
d[i]= Integer.MAX_VALUE;
}
boolean[] disco=new boolean[500];
for (int i = 0; i <500 ; i++) {
…

krise
- 485
- 1
- 10
- 22
0
votes
1 answer
Android Studio says "Expression expected"
Android Studio tells there is an error in Java file, in string summonButton2(); Android Studio says "Expression expected".
I want the method summonButton2 to be launched automatically. I undesrtand that I'm doing it wrong. What exactly…

Eugene Grishin
- 13
- 4
0
votes
1 answer
ExpectedException in xUnit for Legacy Code
As widely stated in other posts, ExpectedException does not exist in xUnit. However, is there something that exists to assist in porting legacy tests to xUnit as essentially a polyfill?
I believe that with an accelerated adoption of .Net Core as we…

J Trana
- 2,150
- 2
- 20
- 32
0
votes
1 answer
Rhino Mock Test Expected #1, Actual #0 - error
I'm newbie working with Rhino Mock and I'm getting this error that I cannot understand why. Here the test
public void TestGet()
{
var installationReference = new Guid("21D7D135-6E9E-4F92-8313-873CA3ABDCD8");
var study =…

Elmer Dantas
- 4,649
- 5
- 30
- 36
0
votes
1 answer
Unit Test expects System.ServiceModel.FaultException
This is my Unit Test:
[TestCategory("Repo")]
[TestMethod]
[ExpectedException(typeof(System.ServiceModel.FaultException))]
public void RepoUnitTest_ExpectError()
{
var repo = new…

fluidguid
- 1,511
- 14
- 25
0
votes
2 answers
Ensure that the method under test has thrown the expected exception, NOT any other part of the test case set up
I am using Visual Studio Unit Test Cases.
I have written the Unit test case where Argument Exception is expected from the method under test MethodUnderTest. Suppose if any other part of the test case (Setup part) throws the expected exception…

Praveen Kumar
- 3
- 2
0
votes
2 answers
Expected response to be a , but was <200> failure
Hi am having this failure
19:44:39 - INFO - Running: test/integration/password_resets_test.rb
Started with run options --seed 54531
DEPRECATION WARNING: You attempted to assign a value which is not explicitly `true` or `false` to a boolean column.…

Pepper 92
- 211
- 1
- 11
0
votes
0 answers
expected expression, got '<' when route in Angular JS
Am changing my routing hash route to Pushstate Route.
All route working except Parameter routing
When am calling ("/profile-page/:Id") kind of routing the error expected expression, got '<' comes in loop.
}, {
url:…

Mack
- 1
0
votes
1 answer
When inverting Vector3 value compiler complains about Syntax
Today im struggling with vectors, and im having problems with this. I have to invert the Y vector value but everytime i compile , Compiler complains about:
Syntax error ',' expected
vector = new Vector3((float) ((-256 + ((iD & 7) * 0x40)) +…

PerikiyoXD
- 3
- 3
0
votes
1 answer
Expected exception attribute limitation in Visual Studio Unit Test
I had to write a unit test for an existing method which maps an enum to another enum. This unit test is concerned about the scenario when the mapping is not defined in the method, and we get an exception in the default block of the switch statement.…

Theepan subramani
- 73
- 1
- 1
- 6
0
votes
1 answer
i'm new in c# and getting error expected; what does it means
using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("hi..! :)");
Console.WriteLine("Welcome to 1st program of console by ali which is marksheet...:P ;)");
…

Ali Asim
- 3
- 2
0
votes
1 answer
Tests with expected exception results with the following error: "The agent process was stopped while the test was running."
I try to automate some unit tests with our TFS build process and some tests results have this error: "The agent process was stopped while the test was running."
All of them have the "ExpectedException" attribute. For example:
…

Joan Granja
- 1
- 1
0
votes
1 answer
Phalcon PHP: test Uniqueness on a natural key?
I've got some code like this:
$this->validate(new \Phalcon\Mvc\Model\Validator\Uniqueness(['field' => $field]));
if (true == $this->validationHasFailed()) {
throw new SpecialInternalUniqueException();
}
This works for all columns except for…

Mr Mikkél
- 2,577
- 4
- 34
- 52