public async Task TestGetSuccessfully() { using (var context = new scriberContext(options)) { TranscriptionsController transcriptionsController = new TranscriptionsController(context); ActionResult <IEnumerable <Transcription> > result = await transcriptionsController.GetTranscription(); Assert.IsNotNull(result); } }
public async Task TestGetSuccessfully() { using (var context = new scriberContext(options)) { TranscriptionsController transcriptionsController = new TranscriptionsController(context); ActionResult <IEnumerable <Transcription> > result = await transcriptionsController.GetTranscription(); Assert.IsNotNull(result); // i should really check to make sure the exact transcriptions are in there, but that requires an equality comparer, // which requires a whole nested class, thanks to C#'s lack of anonymous classes that implement interfaces } }
public async Task TestGetSuccessfully() { using (var context = new GuessContext(Options)) { // make a new transcription controller TranscriptionsController transcriptionsController = new TranscriptionsController(context); // get the result ActionResult <IEnumerable <Transcription> > result = await transcriptionsController.GetTranscription(); // see if the result is null Assert.IsNotNull(result); } }
public async Task TestPutTranscriptionNoContentStatus() { using (var context = new scriberContext(options)) { string title = "this is now a different phrase"; Transcription transcription1 = context.Transcription.Where(x => x.Phrase == transcriptions[0].Phrase).Single(); transcription1.Phrase = title; TranscriptionsController transcriptionsController = new TranscriptionsController(context); IActionResult result = await transcriptionsController.PutTranscription(transcription1.TranscriptionId, transcription1) as IActionResult; Assert.IsNotNull(result); Assert.IsInstanceOfType(result, typeof(NoContentResult)); } }