コード例 #1
0
 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());
 }
コード例 #2
0
        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());
        }
コード例 #3
0
        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());
        }