public async Task GetByIdAsync()
        {
            if (TheaterRepository != null)
            {
                try
                {
                    var result = await TheaterRepository.GetAsync(theater.Id.ToString());

                    Assert.IsNotNull(result);
                }
                catch (Exception e)
                {
                    Assert.Fail(e.Message);
                }
            }
            else
            {
                Assert.Fail();
            }
        }
Example #2
0
        public async Task <Theater> GetAsync(string id)
        {
            var theater = await TheaterRepository.GetAsync(id);

            if (theater != null)
            {
                var locations = await LocationRepository.GetByTheaterId(theater.Id.ToString());

                if (locations.Any())
                {
                    theater.Locations = locations;
                }
            }

            return(theater);
        }