All() public méthode

public All ( ) : IEnumerable
Résultat IEnumerable
        public void GivenADashboardIndexRequest_ThenRespondAListOfExistingTickets()
        {
            var repository = new InMemoryTicketsRepository();
            repository.Create(new Ticket {Name = "ticket-one"});
            repository.Create(new Ticket {Name = "ticket-two"});

            var controller = GetDashboardController(repository);
            var result = controller.Index() as ViewResult;

            Assert.That(result.ViewData.Model, Is.EqualTo(repository.All()));
        }
        public void GivenACreateAction_WhenTheTicketIsValid_ThenItIsCreated()
        {
            var repository = new InMemoryTicketsRepository();
            var controller = GetTicketsController(repository);
            var ticket = new Ticket
            {
                Name = "name",
                PhoneNumber = "phone",
                Description = "description",
                CreatedAt = new DateTime(1985, 8, 26)
            };

            controller.Create(ticket);

            var tickets = repository.All();
            Assert.That(tickets, Contains.Item(ticket));
        }