Skip to content

Instantly share code, notes, and snippets.

@cubanx
Created September 14, 2012 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cubanx/3722533 to your computer and use it in GitHub Desktop.
Save cubanx/3722533 to your computer and use it in GitHub Desktop.
YUNO Maths good?
[Test]
public void It_should_play() {
int completeAttestations = 38;
int totalAttestations = 84;
Expect(Math.Round((double)((completeAttestations * 100) / totalAttestations)), EqualTo(Math.Round(completeAttestations * 100d / totalAttestations)));
var actualUnrounded = (double)((completeAttestations * 100) / totalAttestations);
var expectedUnrounded = completeAttestations * 100d / totalAttestations;
Expect(actualUnrounded, EqualTo(expectedUnrounded), "Actual: <{0}>, Expected: <{1}>".FormatWith(actualUnrounded, expectedUnrounded));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment