public void AddTopic_IsDuplicate_StaysDirty() { var relationships = new NamedTopicCollection("Test"); var related1 = TopicFactory.Create("Topic", "Page"); var related2 = TopicFactory.Create("Topic", "Page"); relationships.Add(related1); try { relationships.Add(related2); } catch (ArgumentException) { //Expected due to duplicate key } Assert.IsTrue(relationships.IsDirty); }
public void AddTopic_IsDirty() { var relationships = new NamedTopicCollection("Test"); var related = TopicFactory.Create("Topic", "Page"); relationships.Add(related); Assert.IsTrue(relationships.IsDirty); }
public void Clear_ExistingTopics_IsDirty() { var relationships = new NamedTopicCollection("Test"); var related = TopicFactory.Create("Topic", "Page"); relationships.Add(related); relationships.IsDirty = false; relationships.Clear(); Assert.IsTrue(relationships.IsDirty); }
public void RemoveTopic_MissingTopic_StaysDirty() { var relationships = new NamedTopicCollection("Test"); var related = TopicFactory.Create("Topic1", "Page"); var missing = TopicFactory.Create("Topic2", "Page"); relationships.Add(related); relationships.Remove(missing); Assert.IsTrue(relationships.IsDirty); }