Example #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");
        }
Example #2
0
        public async void InsertAndGetLanguage()
        {
            Assert.AreEqual(0, _language.PrimaryKey);
            var language = await _persistenceService.Get <Language> (_language.PrimaryKey);

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

            await _persistenceService.Insert(_language);

            Assert.AreNotEqual(0, _language.PrimaryKey);
            language = await _persistenceService.Get <Language> (_language.PrimaryKey);

            AssertionHelper.AssertLanguage(_language, language);
            Assert.Null(language.Location, "Location is not null");

            await _persistenceService.Delete(language);

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

            Assert.Null(language, "language is not null");
        }
 public void DeserializationTest()
 {
     AssertionHelper.AssertLanguage(Mocks.Language, JsonConvert.DeserializeObject <Language> (_serializedLanguage));
 }