Exemplo n.º 1
0
        public async void InsertAndGetLanguageWithLocation()
        {
            var language = await _persistenceService.Get <Language> (_language.PrimaryKey);

            Assert.Null(language, "language is not null");
            var location = await _persistenceService.Get <Location> (_location.Id);

            Assert.Null(location, "location is not null");

            _location.Languages = new List <Language> {
                _language
            };
            await _persistenceService.Insert(_location);

            language = await _persistenceService.Get <Language> (_language.PrimaryKey);

            AssertionHelper.AssertLanguage(_language, language);
            AssertionHelper.AssertLocation(_location, language.Location);

            await _persistenceService.Delete(language);

            language = await _persistenceService.Get <Language> (_language.PrimaryKey);

            Assert.Null(language, "language is not null");
            await _persistenceService.Delete(_location);

            location = await _persistenceService.Get <Location> (_location.Id);

            Assert.Null(location, "location is not null");
        }
Exemplo n.º 2
0
        public async void InsertAndGetLocation()
        {
            var location = await _persistenceService.Get <Location> (_location.Id);

            Assert.Null(location, "location is not null");

            await _persistenceService.Insert(_location);

            location = await _persistenceService.Get <Location> (_location.Id);

            AssertionHelper.AssertLocation(_location, location);

            await _persistenceService.Delete(location);

            location = await _persistenceService.Get <Location> (_location.Id);

            Assert.Null(location, "location is not null");
        }
 public void DeserializationTest()
 {
     AssertionHelper.AssertLocation(Mocks.Location, JsonConvert.DeserializeObject <Location> (_serializedLocation));
 }