public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var studio = id.HasValue ? await _studioService.GetStudio(id.Value) : null;

            if (studio == null)
            {
                return(NotFound());
            }

            return(View(studio));
        }
Exemplo n.º 2
0
        public async Task GetGenreTest()
        {
            int studioId = 1;
            var studio   = new Studio()
            {
                StudioId = studioId, Name = "Studio One"
            };

            var fakeRepositoryMock = new Mock <IStudioRepository>();

            fakeRepositoryMock.Setup(x => x.GetStudio(studioId)).ReturnsAsync(studio);

            var studioService = new StudioService(fakeRepositoryMock.Object);

            var resultStudio = await studioService.GetStudio(studioId);

            Assert.Equal("Studio One", resultStudio.Name);
        }
Exemplo n.º 3
0
 public async Task <Studio> Get(int id)
 {
     return(await studioService.GetStudio(id));
 }