public IActionResult Results() { ViewData["Results"] = Math.Round(TwoThirdAverageGame.GetTwoThirdOfAverage(), 2); ViewData["Winner"] = TwoThirdAverageGame.GetWinner(); ViewData["Second"] = TwoThirdAverageGame.GetSecond(); ViewData["Third"] = TwoThirdAverageGame.GetThird(); ViewData["Count"] = TwoThirdAverageGame.GetNumberOfSubmissions(); return(View()); }
public void FirstSecondThirdPlaceShouldBeInThatOrderOfSubmissionIfTheyAllTie() { string firstPerson = "First Person"; string secondPerson = "Second Person"; string thirdPerson = "Third Person"; TwoThirdAverageGame.Reset(); TwoThirdAverageGame.Submit(firstPerson, 25); TwoThirdAverageGame.Submit(secondPerson, 25); TwoThirdAverageGame.Submit(thirdPerson, 25); TwoThirdAverageGame.ReleaseResults(); Assert.Equal(firstPerson, TwoThirdAverageGame.GetWinner()); Assert.Equal(secondPerson, TwoThirdAverageGame.GetSecond()); Assert.Equal(thirdPerson, TwoThirdAverageGame.GetThird()); }
public void FirstPersonShouldBecomeLastPlaceIfHeReSubmittedInTheCaseOfAllTie() { string firstPerson = "First Person"; string secondPerson = "Second Person"; string thirdPerson = "Third Person"; TwoThirdAverageGame.Reset(); TwoThirdAverageGame.Submit(firstPerson, 25); TwoThirdAverageGame.Submit(secondPerson, 25); TwoThirdAverageGame.Submit(thirdPerson, 25); TwoThirdAverageGame.Submit(firstPerson, 25); TwoThirdAverageGame.ReleaseResults(); Assert.Equal(secondPerson, TwoThirdAverageGame.GetWinner()); Assert.Equal(thirdPerson, TwoThirdAverageGame.GetSecond()); Assert.Equal(firstPerson, TwoThirdAverageGame.GetThird()); }