@@ -113,16 +113,16 @@ public void Export_TopicWithRelationships_MapsRelationshipDataCollection() {
113
113
}
114
114
115
115
/*==========================================================================================================================
116
- | TEST: EXPORT WITH EXTERNAL REFERENCES : TOPIC WITH RELATIONSHIPS: INCLUDE EXTERNAL REFERENCES
116
+ | TEST: EXPORT WITH EXTERNAL ASSOCIATIONS : TOPIC WITH RELATIONSHIPS: INCLUDE EXTERNAL REFERENCES
117
117
\-------------------------------------------------------------------------------------------------------------------------*/
118
118
/// <summary>
119
- /// Creates a <see cref="Topic"/> with several <see cref="Topic.Relationships"/> and ensures that the <see
120
- /// cref="TopicData .Relationships"/> collection <i>does</i> include external references —i.e., relationships that point
121
- /// to <see cref=" Topic"/>s outside of the current export scope—when permitted with the <see
122
- /// cref="ExportOptions.IncludeExternalReferences "/> option.
119
+ /// Creates a <see cref="Topic"/> with several <see cref="Topic.Relationships"/> and ensures that the <see cref="TopicData
120
+ /// .Relationships"/> collection <i>does</i> include external associations —i.e., relationships that reference <see cref="
121
+ /// Topic"/>s outside of the current export scope—when permitted with the <see cref="ExportOptions.
122
+ /// IncludeExternalAssociations "/> option.
123
123
/// </summary>
124
124
[ TestMethod ]
125
- public void ExportWithExternalReferences_TopicWithRelationships_ExcludesExternalReferences ( ) {
125
+ public void ExportWithExternalAssociations_TopicWithRelationships_ExcludesExternalReferences ( ) {
126
126
127
127
var rootTopic = TopicFactory . Create ( "Root" , "Container" ) ;
128
128
var topic = TopicFactory . Create ( "Test" , "Container" , rootTopic ) ;
@@ -132,7 +132,7 @@ public void ExportWithExternalReferences_TopicWithRelationships_ExcludesExternal
132
132
133
133
var topicData = topic . Export (
134
134
new ( ) {
135
- IncludeExternalReferences = true
135
+ IncludeExternalAssociations = true
136
136
}
137
137
) ;
138
138
@@ -184,19 +184,21 @@ public void Export_ExcludesReservedAttributes() {
184
184
185
185
var topicData = topic . Export ( ) ;
186
186
187
- Assert . AreEqual < int > ( 0 , topicData . Attributes . Count ) ;
187
+ Assert . AreEqual < int > ( 1 , topicData . Attributes . Count ) ;
188
+ Assert . AreEqual < string > ( "8" , topicData . Attributes . FirstOrDefault ( ) . Value ) ;
188
189
189
190
}
190
191
191
192
/*==========================================================================================================================
192
- | TEST: EXPORT WITH TOPIC POINTERS : OUT OF SCOPE: SKIPS ATTRIBUTE
193
+ | TEST: EXPORT WITH LEGACY TOPIC REFERENCES : OUT OF SCOPE: SKIPS REFERENCE
193
194
\-------------------------------------------------------------------------------------------------------------------------*/
194
195
/// <summary>
195
- /// Creates a <see cref="Topic"/> with an arbitrary <see cref="AttributeValue"/> that points to a topic outside of the
196
- /// <see cref="ExportOptions.ExportScope"/>. Confirms that it is ignored.
196
+ /// Creates a <see cref="Topic"/> with an arbitrary <see cref="AttributeValue"/> that references a <see cref="Topic.Id"/>
197
+ /// outside of the <see cref="ExportOptions.ExportScope"/>. Confirms that the reference is maintained as an attribute, but
198
+ /// not added as a reference.
197
199
/// </summary>
198
200
[ TestMethod ]
199
- public void ExportWithTopicPointers_OutOfScope_SkipsAttribute ( ) {
201
+ public void ExportWithLegacyTopicReferences_OutOfScope_SkipsReference ( ) {
200
202
201
203
var parentTopic = TopicFactory . Create ( "Root" , "Container" , 5 ) ;
202
204
var topic = TopicFactory . Create ( "Topic" , "Container" , parentTopic ) ;
@@ -206,20 +208,22 @@ public void ExportWithTopicPointers_OutOfScope_SkipsAttribute() {
206
208
var topicData = topic . Export ( ) ;
207
209
208
210
topicData . Attributes . TryGetValue ( "SomeId" , out var someAttribute ) ;
211
+ topicData . References . TryGetValue ( "Some" , out var someReference ) ;
209
212
210
- Assert . IsNull ( someAttribute ) ;
213
+ Assert . IsNotNull ( someAttribute ) ;
214
+ Assert . IsNull ( someReference ) ;
211
215
212
216
}
213
217
214
218
/*==========================================================================================================================
215
- | TEST: EXPORT WITH TOPIC POINTERS : MISSING TOPIC POINTER : SKIPS ATTRIBUTE
219
+ | TEST: EXPORT WITH LEGACY TOPIC REFERENCES : MISSING TOPIC REFERENCE : SKIPS REFERENCE
216
220
\-------------------------------------------------------------------------------------------------------------------------*/
217
221
/// <summary>
218
- /// Creates a <see cref="Topic"/> with an arbitrary <see cref="AttributeValue"/> that points to a missing <see
219
- /// cref=" Topic.Id"/>. Confirms that the attribute is skipped .
222
+ /// Creates a <see cref="Topic"/> with an arbitrary <see cref="AttributeValue"/> that references a missing <see cref="
223
+ /// Topic.Id"/>. Confirms that the reference is maintained as an attribute, but not added as a reference .
220
224
/// </summary>
221
225
[ TestMethod ]
222
- public void ExportWithTopicPointers_MissingTopicPointer_SkipsAttribute ( ) {
226
+ public void ExportWithLegacyTopicReferences_MissingTopicReference_SkipsReference ( ) {
223
227
224
228
var topic = TopicFactory . Create ( "Topic" , "Container" ) ;
225
229
@@ -228,20 +232,24 @@ public void ExportWithTopicPointers_MissingTopicPointer_SkipsAttribute() {
228
232
var topicData = topic . Export ( ) ;
229
233
230
234
topicData . Attributes . TryGetValue ( "InitialBid" , out var initialBidAttribute ) ;
235
+ topicData . References . TryGetValue ( "InitialB" , out var initialBReference ) ;
236
+ topicData . References . TryGetValue ( "InitialB" , out var initialBidReference ) ;
231
237
232
- Assert . IsNull ( initialBidAttribute ) ;
238
+ Assert . IsNotNull ( initialBidAttribute ) ;
239
+ Assert . IsNull ( initialBReference ) ;
240
+ Assert . IsNull ( initialBidReference ) ;
233
241
234
242
}
235
243
236
244
/*==========================================================================================================================
237
- | TEST: EXPORT WITH TOPIC POINTERS : INVALID TOPIC POINTER : EXPORTS ORIGINAL VALUE
245
+ | TEST: EXPORT WITH LEGACY TOPIC REFERENCES : INVALID TOPIC REFERENCE : EXPORTS ORIGINAL VALUE
238
246
\-------------------------------------------------------------------------------------------------------------------------*/
239
247
/// <summary>
240
248
/// Creates a <see cref="Topic"/> with an arbitrary <see cref="AttributeValue"/> that that contains a non-numeric (i.e.,
241
- /// invalid) topic pointers . Confirms that the original value is exported.
249
+ /// invalid) topic reference . Confirms that the original value is exported.
242
250
/// </summary>
243
251
[ TestMethod ]
244
- public void ExportWithTopicPointers_InvalidTopicPointer_ExportsOriginalValue ( ) {
252
+ public void ExportWithLegacyTopicReferences_InvalidTopicReference_ExportsOriginalValue ( ) {
245
253
246
254
var topic = TopicFactory . Create ( "Topic" , "Container" ) ;
247
255
@@ -337,7 +345,7 @@ public void Import_DerivedTopicKey_MapsDerivedTopic() {
337
345
\-------------------------------------------------------------------------------------------------------------------------*/
338
346
/// <summary>
339
347
/// Creates a <see cref="TopicData"/> with a <see cref="AttributeData"/> with the <see cref="AttributeData.Key"/> of <c>
340
- /// BaseTopic</c> in the <see cref="TopicData.References"/> collection, which points to a topic in the topic graph.
348
+ /// BaseTopic</c> in the <see cref="TopicData.References"/> collection, which references a topic in the topic graph.
341
349
/// Ensures that it is correctly wired up.
342
350
/// </summary>
343
351
[ TestMethod ]
@@ -372,8 +380,8 @@ public void Import_BaseTopic_MapsBaseTopic() {
372
380
\-------------------------------------------------------------------------------------------------------------------------*/
373
381
/// <summary>
374
382
/// Creates a <see cref="TopicData"/> with a <see cref="AttributeData"/> with the <see cref="AttributeData.Key"/> of <c>
375
- /// BaseTopic</c> in the <see cref="TopicData.References"/> collection, which points to a newly imported topic that occurs
376
- /// later in the tree, ensuring that the <see cref="Topic.BaseTopic"/> is set correctly.
383
+ /// BaseTopic</c> in the <see cref="TopicData.References"/> collection, which references a newly imported topic that
384
+ /// occurs later in the tree, ensuring that the <see cref="Topic.BaseTopic"/> is set correctly.
377
385
/// </summary>
378
386
[ TestMethod ]
379
387
public void Import_BaseTopic_MapsNewBaseTopic ( ) {
@@ -717,14 +725,14 @@ public void Import_TopicDataWithChild_SkipsOrphanedChild() {
717
725
}
718
726
719
727
/*==========================================================================================================================
720
- | TEST: IMPORT: TOPIC DATA WITH TOPIC POINTER : MAPS TOPIC ID
728
+ | TEST: IMPORT: TOPIC DATA WITH LEGACY TOPIC REFERENCE : MAPS TOPIC ID
721
729
\-------------------------------------------------------------------------------------------------------------------------*/
722
730
/// <summary>
723
- /// Creates a <see cref="TopicData"/> with an arbitrary <see cref="AttributeData"/> that points to another topic. Confirms
724
- /// that it is converted to a <c>TopicID</c > if valid, and otherwise left as is.
731
+ /// Creates a <see cref="TopicData"/> with an arbitrary <see cref="AttributeData"/> that references another topic.
732
+ /// Confirms that it is converted to a <see cref="Topic.Id"/ > if valid, and otherwise left as is.
725
733
/// </summary>
726
734
[ TestMethod ]
727
- public void Import_TopicDataWithTopicPointer_MapsTopicID ( ) {
735
+ public void Import_TopicDataWithLegacyTopicReference_MapsTopicID ( ) {
728
736
729
737
var rootTopic = TopicFactory . Create ( "Root" , "Container" ) ;
730
738
var topic = TopicFactory . Create ( "Topic" , "Container" , rootTopic ) ;
@@ -745,19 +753,19 @@ public void Import_TopicDataWithTopicPointer_MapsTopicID() {
745
753
746
754
topic . Import ( topicData ) ;
747
755
748
- Assert . AreEqual < string > ( "5" , topic . Attributes . GetValue ( "SomeId" ) ) ;
756
+ Assert . AreEqual < int > ( 5 , topic . References . GetValue ( "Some" ) ? . Id ?? - 1 ) ;
749
757
750
758
}
751
759
752
760
/*==========================================================================================================================
753
- | TEST: IMPORT: TOPIC DATA WITH MISSING TOPIC POINTER : SKIPS ATTRIBUTE
761
+ | TEST: IMPORT: TOPIC DATA WITH MISSING LEGACY TOPIC REFERENCE : SKIPS ATTRIBUTE
754
762
\-------------------------------------------------------------------------------------------------------------------------*/
755
763
/// <summary>
756
- /// Creates a <see cref="TopicData"/> with an arbitrary <see cref="AttributeData"/> that points to a missing topic.
764
+ /// Creates a <see cref="TopicData"/> with an arbitrary <see cref="AttributeData"/> that references to a missing topic.
757
765
/// Confirms that the attribute is skipped.
758
766
/// </summary>
759
767
[ TestMethod ]
760
- public void Import_TopicDataWithMissingTopicPointer_SkipsAttribute ( ) {
768
+ public void Import_TopicDataWithMissingLegacyTopicReference_SkipsAttribute ( ) {
761
769
762
770
var topic = TopicFactory . Create ( "Topic" , "Container" ) ;
763
771
@@ -770,7 +778,7 @@ public void Import_TopicDataWithMissingTopicPointer_SkipsAttribute() {
770
778
topicData . Attributes . Add (
771
779
new ( ) {
772
780
Key = "SomeId" ,
773
- Value = "Root:Missing:Topic:Pointer "
781
+ Value = "Root:Missing:Legacy: Topic:Reference "
774
782
}
775
783
) ;
776
784
@@ -781,14 +789,14 @@ public void Import_TopicDataWithMissingTopicPointer_SkipsAttribute() {
781
789
}
782
790
783
791
/*==========================================================================================================================
784
- | TEST: IMPORT: TOPIC DATA WITH INVALID TOPIC POINTER : IMPORTS ORIGINAL VALUE
792
+ | TEST: IMPORT: TOPIC DATA WITH INVALID LEGACY TOPIC REFERENCE : IMPORTS ORIGINAL VALUE
785
793
\-------------------------------------------------------------------------------------------------------------------------*/
786
794
/// <summary>
787
795
/// Creates a <see cref="TopicData"/> with an arbitrary <see cref="AttributeData"/> that does not reference a topic key
788
796
/// (i.e., it doesn't start with <c>Root</c>). Confirms that the original attribute value is imported.
789
797
/// </summary>
790
798
[ TestMethod ]
791
- public void Import_TopicDataWithInvalidTopicPointer_ImportsOriginalValue ( ) {
799
+ public void Import_TopicDataWithInvalidLegacyTopicReference_ImportsOriginalValue ( ) {
792
800
793
801
var topic = TopicFactory . Create ( "Topic" , "Container" ) ;
794
802
@@ -811,6 +819,5 @@ public void Import_TopicDataWithInvalidTopicPointer_ImportsOriginalValue() {
811
819
812
820
}
813
821
814
-
815
822
} //Class
816
823
} //Namespace
0 commit comments