예제 #1
0
        public async Task <List <Theater> > FindAllAsync()
        {
            var theates = await TheaterRepository.FindAllAsync();

            if (theates.Any())
            {
                foreach (var theater in theates)
                {
                    var locations = await LocationRepository.GetByTheaterId(theater.Id.ToString());

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

            return(theates);
        }
        public async Task GetAllAsync()
        {
            if (TheaterRepository != null)
            {
                try
                {
                    var result = await TheaterRepository.FindAllAsync();

                    Assert.IsNotNull(result);
                }
                catch (Exception e)
                {
                    Assert.Fail(e.Message);
                }
            }
            else
            {
                Assert.Fail();
            }
        }