Browsing 7239 questions and answers with Jon Skeet
You don't use Assert.AreEqual, you use Assert.Throws: Assert.Throws<ArgumentOutOfRangeException>(() => Program.nDaysMonth(5, -10)); This checks that the correct exception is thrown. If you want to add more assertions, you can... more 5/19/2015 1:48:33 PM
I suspect you just want BigDecimal.movePointLeft. Returns a BigDecimal which is equivalent to this one with the decimal point moved n places to the left. If n is non-negative, the call merely adds n to the scale. If n is negative, the... more 5/19/2015 9:10:25 AM
You don't need to remove and re-add the reference, but you do need to rebuild all of the projects that compile against the DLL. Adding an optional parameter is a source-compatible but not a binary-compatible change, because the compiler... more 5/19/2015 5:50:09 AM
Look at the XML: <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> ... That's the Envelope element in the namespace with URI "http://www.w3.org/2003/05/soap-envelope". Now look at your... more 5/18/2015 7:07:10 PM
You seem to be expecting to receive an entire XML document - and exactly the XML document - each time you call Stream.Read. That's a really, really dangerous assumption. The stream is a stream of data - while it'll be segmented into... more 5/18/2015 6:42:28 PM
How do I call this from an MVC controller and pass the data back to the view as a List<RssFeedItem>? Usually, you'd do this in another async method, and await the result. For example: public async Task<ActionResult>... more 5/18/2015 5:55:19 PM
You should think of the initial hash as just bytes, not a number. If you're trying to order them for indexed lookup, use whatever ordering is simplest to implement - there's no general purpose "right" or "conventional" here, really. If... more 5/18/2015 5:45:52 PM
If you're happy to truncate towards 0 - and get int.MIN_VALUE or int.MAX_VALUE if the value is out of the range of int - you can just cast: array[Y] = (int) W; If you're not happy with those caveats, you should re-evaluate your design -... more 5/18/2015 4:39:03 PM
Why am I getting this error ? Because while your syntax is valid for initialization in a variable declaration, it's not valid for a plain assignment. You can use: aryProp = new[] { "Width" , button.Width.ToString() }; Or: aryProp... more 5/18/2015 2:11:36 PM
Firstly, you should separate this into two parts: Storing binary data in a database and retrieving it Loading an image file and saving it again There's no need to use a database to test the second part - you should diagnose the issues... more 5/18/2015 11:01:39 AM