@@ -936,7 +936,7 @@ public void Delete_AttributeDescriptor_UpdatesContentTypeCache() {
936936 | TEST: LOAD: TOPIC LOADED EVENT: IS RAISED
937937 \-------------------------------------------------------------------------------------------------------------------------*/
938938 /// <summary>
939- /// Loads a topic using <see cref="StubTopicRepository.Load(Int32, DateTime, Topic?)"/> and ensures that the <see cref="
939+ /// Loads a topic using <see cref="StubTopicRepository.Load(Int32, Topic?, Boolean )"/> and ensures that the <see cref="
940940 /// ITopicRepository.TopicLoaded"/> event is raised.
941941 /// </summary>
942942 [ TestMethod ]
@@ -946,11 +946,39 @@ public void Load_TopicLoadedEvent_IsRaised() {
946946
947947 _cachedTopicRepository . TopicLoaded += eventHandler ;
948948
949- var topic = _topicRepository . Load ( "Root:Web" ) ;
949+ var topic = _topicRepository . Load ( "Root:Web" ) ;
950+
951+ _cachedTopicRepository . TopicLoaded -= eventHandler ;
952+
953+ Assert . IsTrue ( hasFired ) ;
954+
955+ void eventHandler ( object ? sender , TopicLoadEventArgs eventArgs ) => hasFired = true ;
956+
957+ }
958+
959+ /*==========================================================================================================================
960+ | TEST: LOAD: TOPIC LOADED EVENT: IS RAISED WITH VERSION
961+ \-------------------------------------------------------------------------------------------------------------------------*/
962+ /// <summary>
963+ /// Loads a topic using <see cref="StubTopicRepository.Load(Int32, DateTime, Topic?)"/> and ensures that the <see cref="
964+ /// ITopicRepository.TopicLoaded"/> event is raised.
965+ /// </summary>
966+ [ TestMethod ]
967+ public void Load_TopicLoadedEvent_IsRaisedWithVersion ( ) {
968+
969+ var hasFired = false ;
970+ var topicId = _topicRepository . Load ( "Root:Web" ) ? . Id ;
971+ var version = DateTime . UtcNow ;
972+
973+ _cachedTopicRepository . TopicLoaded += eventHandler ;
974+
975+ var topic = _topicRepository . Load ( topicId ?? - 1 , version ) ;
950976
951977 _cachedTopicRepository . TopicLoaded -= eventHandler ;
952978
953979 Assert . IsTrue ( hasFired ) ;
980+ Assert . AreEqual < int ? > ( topicId , topic ? . Id ) ;
981+ Assert . AreEqual < DateTime ? > ( version , topic ? . VersionHistory . LastOrDefault ( ) ) ;
954982
955983 void eventHandler ( object ? sender , TopicLoadEventArgs eventArgs ) => hasFired = true ;
956984
0 commit comments