public void RemoveStyleFromStyleClass_ExpectedParameters_Ok() { StyleClass styleClass = Utils.CreateStyleClassForTest(); Style style = Utils.CreateStyleForTest(); styleClass.AddStyle(style); styleClass.RemoveStyle(style); Assert.IsFalse(styleClass.ProperStyles.Contains(style)); }
public void RemoveStyleFromStyleClass_NotExist_Ok() { StyleClass styleClass = Utils.CreateStyleClassForTest(); int originalCount = styleClass.ProperStyles.Count; Style style = Utils.CreateStyleForTest(); style.Name = "newStyle"; styleClass.RemoveStyle(style); Assert.IsTrue(styleClass.ProperStyles.Count == originalCount); }
public void RemoveStyle(Guid styleClassId, string styleName) { if (Exists(styleClassId)) { if (StyleBusinessLogic.Exists(styleName)) { StyleClass styleClass = StyleClassDataAccess.Get(styleClassId); Style style = StyleBusinessLogic.Get(styleName); styleClass.RemoveStyle(style); StyleClassDataAccess.Modify(styleClass); } else { throw new ArgumentException("Style doesn't exist " + styleName); } } else { throw new ArgumentException("StyleClass doesn't exist " + styleClassId); } }