public void UpdateLanguageIsPersisted()
        {
            using (var businessContext = new BusinessContext())
            {
                var language = new Language
                {
                    Name = "LanguageName"
                };

                businessContext.AddNewLanguage(language);

                language.Name = "New LanguageName";

                businessContext.UpdateLanguage(language);

                bool updated = businessContext.DataContext.Languages.Any(l => l.Id == language.Id && l.Name == language.Name);

                Assert.IsTrue(updated);
            }
        }
Beispiel #2
0
        public void UpdateLanguage_ThrowsException_WhenNameIsEmpty()
        {
            using (var businessContext = new BusinessContext())
            {
                var language = new Language
                {
                    Name = ""
                };

                businessContext.UpdateLanguage(language);
            }
        }
Beispiel #3
0
        public void UpdateLanguage_ThrowsException_WhenLanguageIdDoesNotExist()
        {
            using (var businessContext = new BusinessContext())
            {
                var language = new Language
                {
                    Name = "LanguageName"
                };

                businessContext.UpdateLanguage(language);
            }
        }