|
I can't seem to figure this one out. No matter what I do, I keep getting a "417 Expectation failed" error. Everywhere I've looked says that I need to get rid of the Expect header for the HttpWebRequest. Setting the static property ServicePointManager....
Started by Micah on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Set the Expectation to "expect:nothing" ..this is my code:
var data = new Dictionary();
data.Add("status", status);
request.Expect = "expect:nothing";
var ....
Posting example to the DotNetOpenAuth core library for a future version .
|
|
Again at the Rhino Mocks Noob Wall
mockUI.Expect( x => x.Update( new Frame[] {Frame.MakeIncompleteFrame(1, 5)} ) );
This is the exact argument that I need to match. Via trace statements, I have verified that is the actual output as well i.e. the code...
Started by Gishu on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Don't know if this is THE RhinoMocks way
var expectedFrames = new Frame[] { Frame.MakeIncompleteFrame(1, 5) }; mockUI.Expect( x => x.Update(null) ) .IgnoreArguments() .Constraints( Is.Matching<Frame[]>( frames => HelperPredicates... .
Verified works..
|
|
I'm using jmock to mock out an OutputStream and set expectations on the data that gets written to it.
So I have an expectation that looks something like this
oneOf(stream).write(byteArrayMatching("Some string"));
( byteArrayMatching ) is a factory for...
Started by Kris Pruden on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
The cute answer is that mocking makes more sense against a type that you've defined, that has some domain structure to it, rather... .
I would suggest you log an enhancement to jMock.
There is no way to currently do this in the current (2.5.1) jMock library .
|
Ask your Facebook Friends
|
Assume this ruby code:
class User def self.failed_login!(email) user = User.find_by_email(email) if user user.failed_login_count = user.failed_login_count + 1 user.save end end end
I want to write a test that tests that user.save is never called when ...
Started by Jim Soho on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
In Mocha you can do this:
User.any_instance.expects(:save).never()
alternatively you could do something like
user =... .
For others that might have stumbled unto this, I found the answer in another post that was dealing with RR as the mocking framework.. .
|
|
We are said in LOA books that we must live in the 'NOW' 'cause we shouldn't focus on the past and it's better not to think in the future as it's only illusory. But we're also told to hold a feeling of expectation to manifest things more quickly. Expectation...
Started by BridgetJones09 on
, 7 posts
by 5 people.
Answer Snippets (Read the full thread at inwardquest):
That kind of expectation takes the worry out of what is going to happen for the future must be created....
Of expectation stems, not from wondering about what will happen next, but from the absolute assurance that you know what will happen next.
|
|
I've been evaluating ActiveMQ as a candidate message broker. I've written some test code to try and get an understanding of ActiveMQ's performance limitations.
I can produce a failure state in the broker by sending messages as fast as possible like this...
Started by bcash on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
I know Fiorano has options to specify whether providers block or not in this situation.... .
Not sure about ActiveMQ config, but other JMS providers have various configuration options - so you maybe able to get ActiveMQ to do as you wish in that situation .
|
|
Hi. I'm trying to login to a website using HTTP POST method. I've inspected and altered the POST data while logging in to the website and I came to the conclusion that only the two "username" and "password" fields are required to be passed as POST data...
Started by Phidelity on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
System.Net.HttpWebRequest adds the header 'HTTP header "Expect: 100-Continue"' to every request unless you explicitly.
|
|
I am new to Rhino Mocks, and using mock isolation frameworks in general for unit testing. I have written the following test, where I have set up an expectation for a mock IDataProvider object to return a collection of objects. The collection supplied ...
Started by theringostarrs on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
If you use IgnoreParameters() or ....
I don't think we can tell the code provided, but are you sure your method under tests is calling GetDataSeries with the same params? I'm especially curious about the first parameter, which in the mock is string.empty .
|
|
Hi, I'm mocking a method with easymock that has a date in its body, something like this:
public void testedMethod() { ... if (doSomething(new Date())) { ... }
And my test looks like this:
public void testThatMethod() { ... expect(testedClass.testedMethod...
Started by juniorbl on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
expect.
} //use the same calendar to make the assertion public void testThatMethod() { .. .
())) { ...
|
|
Well I am considering moving and have some interviews in other cities and if the question of salary comes up during the interview I have no idea what to say. How do you guys determine a good range? Just search on monster.ca for similar postings or is ...
Started by Andrew G. Johnson on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Itjobswatch.co.uk for the UK is comprehensive....
Salary.com is probably the best.
There are tons of these tools out there.
Here's the list of countries they have salary info on .
If you're lucky, PayScale.com will have the country/city of origin in its database .
|