Changes to the back-end

As the Speaker Meet application progressed, a new requirement was introduced. Speakers had to be approved before they were visible in parts of the system. This included the full listing of speakers, returning of speaker detail information, and through search results.

In this scenario, a developer came in to help out with the implementation. This developer was not familiar with TDD and did not write tests to validate his work. The new requirement was implemented and a code review was submitted:

public Models.SpeakerDetail Get(int id){  var speaker = _repository.Get(id);  if (speaker == null || speaker.IsDeleted || speaker.IsActive)  {    throw new SpeakerNotFoundException(id);  } var gravatar = _gravatarService.GetGravatar(speaker.EmailAddress); ...

Get Improving your C# Skills now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.