Beispiel #1
0
        public async Task Search_ShouldWorkCorrectly()
        {
            var context = WilderExperienceContextInMemoryFactory.InitializeContext();

            await this.SeedData(context);

            var repository = new EfDeletableEntityRepository <Location>(context);
            var service    = new LocationsService(repository);

            var firstLocation = context.Locations.First();
            var name          = firstLocation.Name;

            var resultLocation      = service.Search <LocationViewModel>(name);
            var firstResultLocation = resultLocation.FirstOrDefault();

            Assert.True(resultLocation.Count() == 1);
            Assert.Equal(firstLocation.Name, firstResultLocation.Name);
        }