Skip to content

Commit 48e8ed4

Browse files
committed
Introduced unit test for Topic.MarkClean(includeCollections)
1 parent 6bbc573 commit 48e8ed4

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

OnTopic.Tests/TopicTest.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,5 +407,29 @@ public void IsDirty_ChangeCollections_ReturnsTrue() {
407407

408408
}
409409

410+
/*==========================================================================================================================
411+
| MARK CLEAN: CHANGE COLLECTION: RESETS IS DIRTY
412+
\-------------------------------------------------------------------------------------------------------------------------*/
413+
/// <summary>
414+
/// Creates an existing topic, changes the <see cref="Topic.Attributes"/>, <see cref="Topic.References"/>, and <see cref=
415+
/// "Topic.Relationships"/> collections, and confirms that <see cref="Topic.MarkClean(Boolean, DateTime?)"/> resets the
416+
/// value of <see cref="Topic.IsDirty(Boolean, Boolean)"/>.
417+
/// </summary>
418+
[TestMethod]
419+
public void MarkClean_ChangeCollection_ResetIsDirty() {
420+
421+
var topic = TopicFactory.Create("Topic", "Page");
422+
var related = TopicFactory.Create("Related", "Page");
423+
424+
topic.Attributes.SetValue("Related", related.Key);
425+
topic.References.SetTopic("Related", related);
426+
topic.Relationships.SetTopic("Related", related);
427+
428+
topic.MarkClean(true);
429+
430+
Assert.IsFalse(topic.IsDirty(true));
431+
432+
}
433+
410434
} //Class
411435
} //Namespace

0 commit comments

Comments
 (0)