|
|
|
@ -61,7 +61,7 @@ describe('Math client', function() { |
|
|
|
|
}); |
|
|
|
|
it('should handle a single request', function(done) { |
|
|
|
|
var arg = {dividend: 7, divisor: 4}; |
|
|
|
|
var call = math_client.Div(arg, function handleDivResult(err, value) { |
|
|
|
|
var call = math_client.div(arg, function handleDivResult(err, value) { |
|
|
|
|
assert.ifError(err); |
|
|
|
|
assert.equal(value.quotient, 1); |
|
|
|
|
assert.equal(value.remainder, 3); |
|
|
|
@ -72,7 +72,7 @@ describe('Math client', function() { |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
it('should handle a server streaming request', function(done) { |
|
|
|
|
var call = math_client.Fib({limit: 7}); |
|
|
|
|
var call = math_client.fib({limit: 7}); |
|
|
|
|
var expected_results = [1, 1, 2, 3, 5, 8, 13]; |
|
|
|
|
var next_expected = 0; |
|
|
|
|
call.on('data', function checkResponse(value) { |
|
|
|
@ -85,7 +85,7 @@ describe('Math client', function() { |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
it('should handle a client streaming request', function(done) { |
|
|
|
|
var call = math_client.Sum(function handleSumResult(err, value) { |
|
|
|
|
var call = math_client.sum(function handleSumResult(err, value) { |
|
|
|
|
assert.ifError(err); |
|
|
|
|
assert.equal(value.num, 21); |
|
|
|
|
}); |
|
|
|
@ -103,7 +103,7 @@ describe('Math client', function() { |
|
|
|
|
assert.equal(value.quotient, index); |
|
|
|
|
assert.equal(value.remainder, 1); |
|
|
|
|
} |
|
|
|
|
var call = math_client.DivMany(); |
|
|
|
|
var call = math_client.divMany(); |
|
|
|
|
var response_index = 0; |
|
|
|
|
call.on('data', function(value) { |
|
|
|
|
checkResponse(response_index, value); |
|
|
|
|