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")); }
public void If_Security_Is_Not_Complex_UserType_Is_Set_Remove_RoleAspect_Node() { Isolate.WhenCalled(() => SecuritySystem.UserType).WillReturn(typeof(User)); var wrapper = new ApplicationNodeWrapper(new Dictionary(new DictionaryNode(ApplicationNodeWrapper.NodeName), Schema.GetCommonSchema())); wrapper.Load(typeof(RoleModelDifferenceObject)); var module = new ModelDifferenceModule(); Isolate.WhenCalled(() => module.AddCultures(null)).IgnoreCall(); module.UpdateModel(wrapper.Dictionary); Assert.AreEqual(0, wrapper.BOModel.Classes.Count); }