Next up we come to the speaker details. We've chosen to continue in the back-end application as we'll tie the entire program together in up coming chapters.
As stated earlier, this is where the real value is delivered for the first set of requirements. User groups and conference organizers will be able to contact a speaker using the information provided in the details view.
To return the details of an individual speaker, a new endpoint is needed. A new method Get
is required which will take an integer ID and return a SpeakerDetail
ViewModel.
To get started, add a new test class named Get
. Now, add a test to check that the Get
method exists.
[Fact] public void ItExists() { // Arrange var speakerServiceMock = new Mock<ISpeakerService>(); var controller = new SpeakerController(speakerServiceMock.Object); // Act var result = controller.Get(); }
Make this test pass by adding a Get
method to the SpeakerController
. Note that, in the following example, the...