Пример #1
0
        public void When_Updating_Model_It_Should_Add_AllCultures_As_Predifined_Values_Of_CurrentLanguage_Member(){
            var dictionary = DictionaryFactory.Create(typeof(ModelDifferenceObject));
            var module = new ModelDifferenceModule();
            Isolate.WhenCalled(() => module.GetAllCultures()).WillReturn("test");

            module.UpdateModel(dictionary);

            var name = new ModelDifferenceObject(Session.DefaultSession).GetPropertyInfo(x=>x.PreferredAspect).Name;
            var single = new ApplicationNodeWrapper(dictionary).BOModel.FindClassByType(typeof(ModelDifferenceObject)).AllProperties.Where(wrapper => wrapper.Name==name).Single();
            Assert.AreEqual("test", single.Node.GetAttributeValue("PredefinedValues"));
        }
Пример #2
0
        public void DefaultLanguage_IsContained_In_Cultures(){
            var module = new ModelDifferenceModule();

            var cultures = module.GetAllCultures();

            var strings = cultures.Split(';');
            Assert.AreEqual(CultureInfo.GetCultures(CultureTypes.AllCultures).Count()+1, strings.Length);
            Assert.AreEqual(DictionaryAttribute.DefaultLanguage, strings[0]);
        }