public void InMemoryParticipantStore_canDeleteItem()
        {
            //Arrange
            var participant1     = new Participant(null, "Bob", "Smith");
            var participant2     = new Participant(null, "John", "Doe");
            var participantArray = new Participant[] { participant1, participant2 };

            IRepository <Participant> store = new InMemoryParticipantStore();

            participantArray = store.Add(participantArray).ToArray();
            participant1     = participantArray[0];
            participant2     = participantArray[1];

            //Act
            store.Delete(participant1);

            //Assert
            var remainingParticipants = store.All();

            Assert.That(remainingParticipants.Count(), Is.EqualTo(1));

            var participantLeft = remainingParticipants.ToArray()[0];

            // Looking for no side effects
            Assert.That(participantLeft.ID, Is.EqualTo(participant2.ID));
            Assert.That(participantLeft.FirstName, Is.EqualTo(participant2.FirstName));
            Assert.That(participantLeft.LastName, Is.EqualTo(participant2.LastName));
        }
        public void InMemoryParticipantStore_CanDelete()
        {
            //Setup
            List <Participant> originalList = new List <Participant>();
            var participantToDelete         = new Participant(1, "Bob", "Smith");
            var secondParticipant           = new Participant(2, "Joe", "Doe");

            originalList.Add(participantToDelete);
            originalList.Add(secondParticipant);

            IRepository <Participant> store = new InMemoryParticipantStore(originalList);

            store.Delete(p => p.ID == participantToDelete.ID);

            var resultList           = store.All().ToList();
            var remainingParticipant = resultList.SingleOrDefault(p => p.ID == secondParticipant.ID);

            //Assert Results
            Assert.That(resultList.Count, Is.EqualTo(1));
            Assert.That(remainingParticipant, Is.Not.Null);
        }