private static double CheckCase(Beatmap bm, ExpectedOutcome outcome, out double margin) { const double errorMargin = 0.02; margin = errorMargin * outcome.PP; var pp = new PPv2(outcome.ToParameters(bm)); if (outcome.PP < 100) { margin *= 3; } else if (outcome.PP < 200) { margin *= 2; } else if (outcome.PP < 300) { margin *= 1.5; } return(pp.Total); }
public void CharacterStreamPeekTest() { string testInput = "abcdefghijklmnopqrstuvwxyz"; ExpectedOutcome expected = new ExpectedOutcome() { ch= 'e', loc= new StreamLocation(4, 1, 5) }; CharacterScanner sut = new CharacterScanner(testInput); sut.Start(); for (int i = 0; i < 4; ++i) sut.Consume(); Assert.AreEqual(expected.ch, sut.Peek()); Assert.AreEqual(expected.loc, sut.Location); Assert.AreEqual(expected.ch, sut.Peek(), "unexpected change!"); Assert.AreEqual(expected.loc, sut.Location, "unexpected change!"); }