Ejemplo n.º 1
0
        public void GiveTicketsToStudent_IgnoresNonPositiveNumbers(int tickets)
        {
            var cp = new ClassPeriod();

            cp.AddStudent("Black Canary");
            cp.GiveTicketsTo(cp.Students.Last(), tickets);
            cp.Students.Single().Tickets.Should().Be(0);
        }
Ejemplo n.º 2
0
        public void GiveTicketsToStudent_StartValue3_AddsTickets()
        {
            var cp = new ClassPeriod();

            cp.Students.Add(new Student {
                Name = "Killer Frost", Tickets = 3
            });
            cp.GiveTicketsTo(cp.Students.Last(), 4);
            cp.Students.Single().Tickets.Should().Be(7);
        }
Ejemplo n.º 3
0
        public void GiveTicketsToStudent_StartValue0_TotalTicketsEqualToHowManyGiven(int tickets)
        {
            var cp = new ClassPeriod();

            cp.Students.Add(new Student {
                Name = "Killer Frost"
            });
            cp.GiveTicketsTo(cp.Students.Last(), tickets);
            cp.Students.Last().Tickets.Should().Be(tickets);
        }
Ejemplo n.º 4
0
        public void GiveTicketsToStudent_OnlyAffectsSpecifiedStudent()
        {
            var cp = new ClassPeriod();

            cp.Students.Add(new Student {
                Name = "Black Canary", Tickets = 2
            });
            cp.Students.Add(new Student {
                Name = "Killer Frost", Tickets = 3
            });

            cp.GiveTicketsTo(cp.Students.Last(), 4);

            cp.Students.First().Tickets.Should().Be(2, "this student should not have received any tickets");
            cp.Students.Last().Tickets.Should().Be(7);
        }