Example #1
0
 public string FuehreAus(IScorecard scorecard)
 {
     scorecard.ErhoeheAnzahlSchlaege();
     return(string.Format("Du hast {0} {1}.",
                          new Schlagausgabe().FuehreAus(scorecard),
                          new Lochausgabe().FuehreAus(scorecard)));
 }
        public void ScoreCard_ZeilenAusgabe()
        {
            _scorecard.ErhoeheAnzahlSchlaege();
            _scorecard.SchliesseLochAb();

            string resultText = new ScorecardOperation().FuehreAus(_scorecard);
            var    lines      = resultText.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
            var    secondLine = lines[1];

            secondLine = secondLine.Replace(" ", string.Empty);

            Assert.That(secondLine.StartsWith("1") && secondLine.EndsWith("1"), "Loch und Anzahl ist wrong");

            var thirdLine = lines[2];

            thirdLine = thirdLine.Replace(" ", string.Empty);
            Assert.That(thirdLine.StartsWith("2") && thirdLine.EndsWith("0"), "Loch und Anzahl ist wrong");
        }
Example #3
0
 public void InkrementiertSchlagzahlEinmal()
 {
     _scorecard.ErhoeheAnzahlSchlaege();
     Assert.That(_scorecard.AnzahlSchlaege, Is.EqualTo(1));
 }
Example #4
0
 public string FuehreAus(IScorecard scorecard, ITracker tracker)
 {
     scorecard.ErhoeheAnzahlSchlaege();
     return("");
 }