예제 #1
0
        public void Should_make_master_language()
        {
            var config = LanguagesConfig.Create(Language.DE).Add(Language.IT).MakeMaster(Language.IT);

            Assert.Equal(Language.IT, config.Master.Language);
        }
예제 #2
0
        public void Should_throw_exception_if_language_to_make_optional_must_be_set_to_master()
        {
            var config = LanguagesConfig.Create(Language.DE).Add(Language.IT);

            Assert.Throws <ValidationException>(() => config.Update(Language.DE, true, true, null));
        }
예제 #3
0
        public void Should_throw_exception_if_language_to_add_already_exists()
        {
            var config = LanguagesConfig.Create(Language.DE);

            Assert.Throws <ValidationException>(() => config.Add(Language.DE));
        }
예제 #4
0
        public void Should_throw_exception_if_fallback_language_is_invalid()
        {
            var config = LanguagesConfig.Create(Language.DE);

            Assert.Throws <ValidationException>(() => config.Update(Language.DE, false, false, new[] { Language.EN }));
        }
예제 #5
0
        public void Should_throw_exception_if_language_to_make_optional_is_master_language()
        {
            var config = LanguagesConfig.Create(Language.DE);

            Assert.Throws <ValidationException>(() => config.Update(Language.DE, true, false, null));
        }
예제 #6
0
        public void Should_throw_exception_if_language_to_update_is_not_found()
        {
            var config = LanguagesConfig.Create(Language.DE);

            Assert.Throws <DomainObjectNotFoundException>(() => config.Update(Language.EN, true, false, null));
        }
예제 #7
0
        public void Should_also_set_make_master_when_updating_language()
        {
            var config = LanguagesConfig.Create(Language.DE).Add(Language.IT).Update(Language.IT, false, true, null);

            Assert.Equal(Language.IT, config.Master.Language);
        }
예제 #8
0
        public void Should_throw_exception_if_language_to_remove_is_master_language()
        {
            var config = LanguagesConfig.Create(Language.DE);

            Assert.Throws <ValidationException>(() => config.Remove(Language.DE));
        }
예제 #9
0
        public void Should_throw_exception_if_language_to_remove_is_not_found()
        {
            var config = LanguagesConfig.Create(Language.DE);

            Assert.Throws <DomainObjectNotFoundException>(() => config.Remove(Language.EN));
        }
예제 #10
0
        public void Should_not_throw_exception_if_language_is_already_master_language()
        {
            var config = LanguagesConfig.Create(Language.DE);

            config.MakeMaster(Language.DE);
        }