Questions tagged [expectations]

defines a set of expected and/or allowed method/constructor invocations on the mocked types/instances that have been made available to the test through mock fields and/or mock parameters (e.g., in JMockit).

121 questions
0
votes
1 answer

expect_any_instance_of usage in Rspec3

Here the docu: https://relishapp.com/rspec/rspec-mocks/v/3-0/docs/message-expectations/expect-a-message-on-any-instance-of-a-class Im wondering what is the right use of it. I have a controller class UserController < ApplicationController def edit …
Denny Mueller
  • 3,505
  • 5
  • 36
  • 67
0
votes
1 answer

Equivalent of Hippomocks' previously existing MockRepository::ClassMock

In the official version 3.1 of Hippomocks (https://www.assembla.com/spaces/hippomocks/wiki/Home) there used to be a MockRepository::ClassMock that constructed mocked objects (contrary to MockRepository::InterfaceMock that doesn't) which can be very…
Roland Sarrazin
  • 1,203
  • 11
  • 29
0
votes
3 answers

Semicolon, Expectations, and (end)

I was proofreading this function with JSFiddle, and it said there is a missing semicolon on the second line, however, I cannot determine where it would go. function debtSpiral() { var debtID = setInterval(debtIncrease() { //Sets variable for…
0
votes
2 answers

Weight parameter in GMM and Expectation Maximization

I am working in programming of GMM with EM. I am stuck with the following problem. As you will see in this website, there is a parameter "pi" which is in other words the weight or probability value. My question is how is this calculated? Or is it…
kcc__
  • 1,638
  • 4
  • 30
  • 59
0
votes
1 answer

Setting expectations on MoQ

I'm using MoQ to test some controllers I have. I'm not able to set the expectations. This is the code I have: var rep = new Mock(); rep.Setup(r => r.Save()); The problem is that my Save() method expects a User…
tucaz
  • 6,524
  • 6
  • 37
  • 60
0
votes
1 answer

jmockit expectations NPE

I have this piece of code: new Expectations(){ { mFubar.getModel(); result = new Model(); times = 1; mFubar.getModel().getAllDogs(); result = new HashSet(); times = 1; } }; Unfortunately I always get a null…
nano_nano
  • 12,351
  • 8
  • 55
  • 83
0
votes
2 answers

expected ';' at the end of declaration list

error:- expected ';' at the end of the declaration list #import @interface ViewController : UIViewController { float number; error:- expected ';' at the end of the declaration list float result; int…
thejustv
  • 2,009
  • 26
  • 42
0
votes
2 answers

How to test if a method was called using nmock3?

I'm trying trying to set the expectation that a method will be called. But when I write the lambda expresion inside the Method method, I get an error because I'm not passing the parameters. I don't care about the instance of the parameters, I only…
Martín La Rosa
  • 790
  • 4
  • 17
0
votes
2 answers

Is there a "should" minitest gem?

I would like to use fluent assertions type of syntax with minitest result.should_be "my result" result.should_be_true result.should_contain "foo" Is there some gem that adds this functionality? My request come from a similar idea in C#.
David MZ
  • 3,648
  • 6
  • 33
  • 50
0
votes
1 answer

Sum all possible values a player can have in a two player game

This is a classical game where two players play following game: There are n coins in a row with different denominations. In this game, players pick a coin from extreme left or extreme right (they blindly pick from any extreme with a probability of…
iwc2010005
  • 189
  • 2
  • 6
0
votes
1 answer

Create ScalaMock 2.4 ProxyMock without expectations

Say, my class Person collaborates with other classes, Kettle and Teacup. Person has a method makeTea() that should interact with Kettle and Teacup, each in different ways, in succession, but the order is unimportant.I would like to capture…
fatuhoku
  • 4,815
  • 3
  • 30
  • 70
0
votes
1 answer

RSpec: force Net::SFTP::StatusException and validate rescue

I'm trying to force an Net::SFTP::StatusException error in my spec and then validate that my code traps it. Code: def process_SFTP(username, password, csvfile) begin mySftpWrapper.new mySftpWrapper.process_CSV_file(csvfile) rescue…
Sly
  • 743
  • 13
  • 38
0
votes
1 answer

Saving return value of a Expectation

I want to use return vale of a expectation to add to one more expection. I have a m_accountProcessor object which has interface createAccount to create a new account and returns a Account object. I want to save this object and add it to one more…
Sirish
  • 9,183
  • 22
  • 72
  • 107
-1
votes
1 answer

Single global instance for multiple test cases in unit testing

I want to setup a global instance variable for all the test cases. Currently I could setup the variable for one test case but it is not set for the other. Mentioned below is my setup code. func setupLightController() { let btLight =…
Nasim Rony
  • 519
  • 5
  • 22
-1
votes
1 answer

probability , expectations in $L^1$

I found this in another language. I am wondering if anyone could find this in a English book please. Or if anyone know how to prove this please. Preferably one could tell me a reference book. Thank you very much. Let $(\Omega, F, P)$ be a…
G-09
  • 345
  • 2
  • 13
1 2 3
8
9