Update prime factors to return longs#1312
Conversation
cb7707a to
8aa0423
Compare
ErikSchierboom
left a comment
There was a problem hiding this comment.
Looking good. Two small suggestions
| { | ||
| testMethod.Input["value"] = (long)testMethod.Input["value"]; | ||
|
|
||
| if (testMethod.Expected is int[]) |
There was a problem hiding this comment.
I'm on mobile, so that makes reviewing a bit harder. I think you can do "Expected is int[] expected", which allows you to remove the cast below.
There was a problem hiding this comment.
Nice I didn't know you could do that!
|
|
||
| if (testMethod.Expected is int[]) | ||
| { | ||
| testMethod.Expected = ((int[])testMethod.Expected).Select(l => (long)l).ToArray(); |
There was a problem hiding this comment.
I'm not entirely sure if it works, but you could check to see if instead of the select and the lambda, you could use "Cast".
There was a problem hiding this comment.
I tried the following:
testMethod.Expected = expected.Cast<long>();
But that gives the following error:
Unable to cast object of type 'System.Int32' to type 'System.Int64'.'
I'd expect that error in the other sense, but not here... 🤔
8aa0423 to
4fccf45
Compare
|
Thanks! |
Fixes #1309