Skip to content

Commit f51407a

Browse files
committed
Merge branch 'feature/TrackedRecord' into develop
Established the naming convention of "record" for classes which contain not only the value, but also metadata about the value, such as `IsDirty` and `Version`. This helps unify the concept of `AttributeRecord` (previously `AttributeValue`) and `TopicReferenceRecord` (previously `TopicReference`), both of which are stored in collections derived from `TrackedRecordCollection` (previously `TrackedCollection`). This includes the following renames: - `TrackedItem<T>` to `TrackedRecord<T>` (a6db252). - `TrackedCollection<>` to `TrackedRecordCollection<>` (453c9e9). - `TopicReference` to `TopicReferenceRecord` (6960800). - `AttributeValue` to `AttributeRecord` (f41c551). - `AttributeValueCollection` to `AttributeCollection` (400520b, d18d0eb). - `AttributeValueCollectionExtensions` to `AttributeCollectionExtensions` (4c99dbc).
2 parents fa2a880 + d4b2ec3 commit f51407a

29 files changed

+458
-457
lines changed

OnTopic.Data.Sql/Models/AttributeValuesDataTable.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ internal AttributeValuesDataTable() {
3838
| COLUMN: Attribute Value
3939
\-----------------------------------------------------------------------------------------------------------------------*/
4040
Columns.Add(
41-
new DataColumn("AttributeValue") {
41+
new DataColumn("AttributeRecord") {
4242
MaxLength = 255
4343
}
4444
);
@@ -51,16 +51,16 @@ internal AttributeValuesDataTable() {
5151
/// <summary>
5252
/// Provides a convenience method for adding a new <see cref="DataRow"/> based on the expected column values.
5353
/// </summary>
54-
/// <param name="attributeKey">The <see cref="AttributeValue.Key"/>.</param>
55-
/// <param name="attributeValue">The <see cref="AttributeValue.Value"/>.</param>
54+
/// <param name="attributeKey">The <see cref="AttributeRecord.Key"/>.</param>
55+
/// <param name="attributeValue">The <see cref="AttributeRecord.Value"/>.</param>
5656
internal DataRow AddRow(string attributeKey, string? attributeValue = null) {
5757

5858
/*------------------------------------------------------------------------------------------------------------------------
5959
| Define record
6060
\-----------------------------------------------------------------------------------------------------------------------*/
6161
var record = NewRow();
6262
record["AttributeKey"] = attributeKey;
63-
record["AttributeValue"] = attributeValue;
63+
record["AttributeRecord"] = attributeValue;
6464

6565
/*------------------------------------------------------------------------------------------------------------------------
6666
| Add record

OnTopic.TestDoubles/StubTopicRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected override void DeleteTopic(Topic topic) { }
139139
| METHOD: GET ATTRIBUTES (PROXY)
140140
\-------------------------------------------------------------------------------------------------------------------------*/
141141
/// <inheritdoc cref="TopicRepository.GetAttributes(Topic, Boolean?, Boolean?)" />
142-
public IEnumerable<AttributeValue> GetAttributesProxy(
142+
public IEnumerable<AttributeRecord> GetAttributesProxy(
143143
Topic topic,
144144
bool? isExtendedAttribute,
145145
bool? isDirty = null,

OnTopic.Tests/AttributeValueCollectionTest.cs renamed to OnTopic.Tests/AttributeCollectionTest.cs

Lines changed: 53 additions & 53 deletions
Large diffs are not rendered by default.

OnTopic.Tests/ITopicRepositoryTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace OnTopic.Tests {
1717
| CLASS: TOPIC REPOSITORY TEST
1818
\---------------------------------------------------------------------------------------------------------------------------*/
1919
/// <summary>
20-
/// Provides unit tests for the <see cref="AttributeValueCollection"/> class.
20+
/// Provides unit tests for the <see cref="AttributeCollection"/> class.
2121
/// </summary>
2222
/// <remarks>
2323
/// These tests not only validate that the <see cref="StubTopicRepository"/> is functioning as expected, but also that the

OnTopic.Tests/TopicReferenceCollectionTest.cs

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ namespace OnTopic.Tests {
1717
\---------------------------------------------------------------------------------------------------------------------------*/
1818
/// <summary>
1919
/// Provides unit tests for the <see cref="TopicReferenceCollection"/>, with a particular emphasis on the custom features
20-
/// such as <see cref="TrackedCollection{TItem, TValue, TAttribute}.IsDirty()"/>, <see cref="TrackedCollection{TItem,
21-
/// TValue, TAttribute}.GetValue(String, Boolean)"/>, <see cref="TrackedCollection{TItem, TValue, TAttribute}.SetValue(
22-
/// String, TValue, Boolean?, DateTime?)"/>, and the cross-referencing of reciprocal values in the <see cref="Topic.
23-
/// IncomingRelationships"/> property.
20+
/// such as <see cref="TrackedRecordCollection{TItem, TValue, TAttribute}.IsDirty()"/>, <see cref="TrackedRecordCollection{
21+
/// TItem, TValue, TAttribute}.GetValue(String, Boolean)"/>, <see cref="TrackedRecordCollection{TItem, TValue, TAttribute}.
22+
/// SetValue(String, TValue, Boolean?, DateTime?)"/>, and the cross-referencing of reciprocal values in the <see cref="
23+
/// Topic.IncomingRelationships"/> property.
2424
/// </summary>
2525
[TestClass]
2626
public class TopicReferenceCollectionTest {
@@ -30,7 +30,7 @@ public class TopicReferenceCollectionTest {
3030
\-------------------------------------------------------------------------------------------------------------------------*/
3131
/// <summary>
3232
/// Assembles a new <see cref="TopicReferenceCollection"/>, adds a new <see cref="Topic"/> reference, and confirms that
33-
/// <see cref="TrackedCollection{TItem, TValue, TAttribute}.IsDirty()"/> is correctly set.
33+
/// <see cref="TrackedRecordCollection{TItem, TValue, TAttribute}.IsDirty()"/> is correctly set.
3434
/// </summary>
3535
[TestMethod]
3636
public void Add_NewReference_IsDirty() {
@@ -50,8 +50,8 @@ public void Add_NewReference_IsDirty() {
5050
\-------------------------------------------------------------------------------------------------------------------------*/
5151
/// <summary>
5252
/// Assembles a new <see cref="TopicReferenceCollection"/>, adds a new <see cref="Topic"/> reference using <see cref="
53-
/// TrackedCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?, DateTime?)"/>, and confirms that <see
54-
/// cref="TrackedCollection{TItem, TValue, TAttribute}.IsDirty()"/> is not set.
53+
/// TrackedRecordCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?, DateTime?)"/>, and confirms that
54+
/// <see cref="TrackedRecordCollection{TItem, TValue, TAttribute}.IsDirty()"/> is not set.
5555
/// </summary>
5656
[TestMethod]
5757
public void SetValue_NewReference_NotDirty() {
@@ -71,8 +71,8 @@ public void SetValue_NewReference_NotDirty() {
7171
\-------------------------------------------------------------------------------------------------------------------------*/
7272
/// <summary>
7373
/// Assembles a new <see cref="TopicReferenceCollection"/> with a topic reference, removes that reference using <see cref=
74-
/// "TrackedCollection{TItem, TValue, TAttribute}.RemoveItem(Int32)"/>, and confirms that <see cref="TrackedCollection{
75-
/// TItem, TValue, TAttribute}.IsDirty()"/> is set.
74+
/// "TrackedRecordCollection{TItem, TValue, TAttribute}.RemoveItem(Int32)"/>, and confirms that <see cref="
75+
/// TrackedRecordCollection{TItem, TValue, TAttribute}.IsDirty()"/> is set.
7676
/// </summary>
7777
[TestMethod]
7878
public void Remove_ExistingReference_IsDirty() {
@@ -93,9 +93,9 @@ public void Remove_ExistingReference_IsDirty() {
9393
\-------------------------------------------------------------------------------------------------------------------------*/
9494
/// <summary>
9595
/// Assembles a new <see cref="TopicReferenceCollection"/>, adds a new <see cref="Topic"/> reference using <see cref="
96-
/// TrackedCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?, DateTime?)"/>, calls <see cref="
97-
/// TrackedCollection{TItem, TValue, TAttribute}.ClearItems()"/> and confirms that <see cref="TrackedCollection{TItem,
98-
/// TValue, TAttribute}.IsDirty()"/> is set.
96+
/// TrackedRecordCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?, DateTime?)"/>, calls <see cref="
97+
/// TrackedRecordCollection{TItem, TValue, TAttribute}.ClearItems()"/> and confirms that <see cref="
98+
/// TrackedRecordCollection{TItem, TValue, TAttribute}.IsDirty()"/> is set.
9999
/// </summary>
100100
[TestMethod]
101101
public void Clear_ExistingReferences_IsDirty() {
@@ -116,9 +116,9 @@ public void Clear_ExistingReferences_IsDirty() {
116116
\-------------------------------------------------------------------------------------------------------------------------*/
117117
/// <summary>
118118
/// Assembles a new <see cref="TopicReferenceCollection"/> and adds a new <see cref="Topic"/> reference using <see cref="
119-
/// KeyedCollection{TKey, TItem}.InsertItem(Int32, TItem)"/> with <see cref="TrackedItem{T}.IsDirty"/> set to <c>false
120-
/// </c>, confirming that <see cref="TrackedCollection{TItem, TValue, TAttribute}.IsDirty()"/> remains <c>true</c> since
121-
/// the target <see cref="Topic"/> is unsaved.
119+
/// KeyedCollection{TKey, TItem}.InsertItem(Int32, TItem)"/> with <see cref="TrackedRecord{T}.IsDirty"/> set to <c>false
120+
/// </c>, confirming that <see cref="TrackedRecordCollection{TItem, TValue, TAttribute}.IsDirty()"/> remains <c>true</c>
121+
/// since the target <see cref="Topic"/> is unsaved.
122122
/// </summary>
123123
[TestMethod]
124124
public void Add_NewTopic_IsDirty() {
@@ -137,8 +137,8 @@ public void Add_NewTopic_IsDirty() {
137137
\-------------------------------------------------------------------------------------------------------------------------*/
138138
/// <summary>
139139
/// Assembles a new <see cref="TopicReferenceCollection"/>, adds a new <see cref="Topic"/> reference using <see cref="
140-
/// TrackedCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?, DateTime?)"/>, and confirms that <see
141-
/// cref="Topic.IncomingRelationships"/> reference is correctly set.
140+
/// TrackedRecordCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?, DateTime?)"/>, and confirms that
141+
/// <see cref="Topic.IncomingRelationships"/> reference is correctly set.
142142
/// </summary>
143143
[TestMethod]
144144
public void Add_NewReference_IncomingRelationshipSet() {
@@ -157,9 +157,9 @@ public void Add_NewReference_IncomingRelationshipSet() {
157157
\-------------------------------------------------------------------------------------------------------------------------*/
158158
/// <summary>
159159
/// Assembles a new <see cref="TopicReferenceCollection"/>, adds a new <see cref="Topic"/> reference using <see cref="
160-
/// TrackedCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?, DateTime?)"/>, removes the reference
161-
/// using <see cref="TrackedCollection{TItem, TValue, TAttribute}.RemoveItem(Int32)"/>, and confirms that the <see cref="
162-
/// Topic.IncomingRelationships"/> reference is correctly removed as well.
160+
/// TrackedRecordCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?, DateTime?)"/>, removes the
161+
/// reference using <see cref="TrackedRecordCollection{TItem, TValue, TAttribute}.RemoveItem(Int32)"/>, and confirms that
162+
/// the <see cref="Topic.IncomingRelationships"/> reference is correctly removed as well.
163163
/// </summary>
164164
[TestMethod]
165165
public void Remove_ExistingReference_IncomingRelationshipRemoved() {
@@ -179,9 +179,9 @@ public void Remove_ExistingReference_IncomingRelationshipRemoved() {
179179
\-------------------------------------------------------------------------------------------------------------------------*/
180180
/// <summary>
181181
/// Assembles a new <see cref="TopicReferenceCollection"/>, adds a new <see cref="Topic"/> reference using <see cref="
182-
/// TrackedCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?, DateTime?)"/>, updates the reference
183-
/// using <see cref="TrackedCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?, DateTime?)"/>, and
184-
/// confirms that the <see cref="Topic"/> reference is correctly updated.
182+
/// TrackedRecordCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?, DateTime?)"/>, updates the
183+
/// reference using <see cref="TrackedRecordCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?,
184+
/// DateTime?)"/>, and confirms that the <see cref="Topic"/> reference is correctly updated.
185185
/// </summary>
186186
[TestMethod]
187187
public void SetValue_ExistingReference_TopicUpdated() {
@@ -202,9 +202,9 @@ public void SetValue_ExistingReference_TopicUpdated() {
202202
\-------------------------------------------------------------------------------------------------------------------------*/
203203
/// <summary>
204204
/// Assembles a new <see cref="TopicReferenceCollection"/>, adds a new <see cref="Topic"/> reference using <see cref="
205-
/// TrackedCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?, DateTime?)"/>, updates the reference
206-
/// with a null value using <see cref="TrackedCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?,
207-
/// DateTime?)"/>, and confirms that the <see cref="Topic"/> reference is correctly removed.
205+
/// TrackedRecordCollection{TItem, TValue, TAttribute}.SetValue(String, TValue, Boolean?, DateTime?)"/>, updates the
206+
/// reference with a null value using <see cref="TrackedRecordCollection{TItem, TValue, TAttribute}.SetValue(String,
207+
/// TValue, Boolean?, DateTime?)"/>, and confirms that the <see cref="Topic"/> reference is correctly removed.
208208
/// </summary>
209209
[TestMethod]
210210
public void SetValue_NullReference_TopicRemoved() {
@@ -245,8 +245,8 @@ public void Add_NewReference_TopicIsDirty() {
245245
\-------------------------------------------------------------------------------------------------------------------------*/
246246
/// <summary>
247247
/// Assembles a new <see cref="TopicReferenceCollection"/>, adds a new <see cref="Topic"/> reference, and confirms that
248-
/// <see cref="TrackedCollection{TItem, TValue, TAttribute}.GetValue(String, Boolean)"/> correctly returns the <see cref="
249-
/// Topic"/>.
248+
/// <see cref="TrackedRecordCollection{TItem, TValue, TAttribute}.GetValue(String, Boolean)"/> correctly returns the <see
249+
/// cref="Topic"/>.
250250
/// </summary>
251251
[TestMethod]
252252
public void GetTopic_ExistingReference_ReturnsTopic() {
@@ -265,8 +265,8 @@ public void GetTopic_ExistingReference_ReturnsTopic() {
265265
\-------------------------------------------------------------------------------------------------------------------------*/
266266
/// <summary>
267267
/// Assembles a new <see cref="TopicReferenceCollection"/>, adds a new <see cref="Topic"/> reference, and confirms that
268-
/// <see cref="TrackedCollection{TItem, TValue, TAttribute}.GetValue(String, Boolean)"/> correctly returns <c>null</c> if
269-
/// an incorrect <c>referencedKey</c> is entered.
268+
/// <see cref="TrackedRecordCollection{TItem, TValue, TAttribute}.GetValue(String, Boolean)"/> correctly returns <c>null
269+
/// </c> if an incorrect <c>referencedKey</c> is entered.
270270
/// </summary>
271271
[TestMethod]
272272
public void GetTopic_MissingReference_ReturnsNull() {
@@ -285,8 +285,8 @@ public void GetTopic_MissingReference_ReturnsNull() {
285285
\-------------------------------------------------------------------------------------------------------------------------*/
286286
/// <summary>
287287
/// Assembles a new <see cref="TopicReferenceCollection"/> with a <see cref="Topic.BaseTopic"/>, adds a new <see cref="
288-
/// Topic"/> reference to the <see cref="Topic.BaseTopic"/>, and confirms that <see cref="TrackedCollection{TItem, TValue,
289-
/// TAttribute}.GetValue(String, Boolean)"/> correctly returns the related topic reference.
288+
/// Topic"/> reference to the <see cref="Topic.BaseTopic"/>, and confirms that <see cref="TrackedRecordCollection{TItem,
289+
/// TValue, TAttribute}.GetValue(String, Boolean)"/> correctly returns the related topic reference.
290290
/// </summary>
291291
[TestMethod]
292292
public void GetTopic_InheritedReference_ReturnsTopic() {
@@ -307,8 +307,8 @@ public void GetTopic_InheritedReference_ReturnsTopic() {
307307
\-------------------------------------------------------------------------------------------------------------------------*/
308308
/// <summary>
309309
/// Assembles a new <see cref="TopicReferenceCollection"/> with a <see cref="Topic.BaseTopic"/>, adds a new <see cref="
310-
/// Topic"/> reference to the <see cref="Topic.BaseTopic"/>, and confirms that <see cref="TrackedCollection{TItem, TValue,
311-
/// TAttribute}.GetValue(String, Boolean)"/> correctly returns <c>null</c> if an incorrect <c>referencedKey</c> is
310+
/// Topic"/> reference to the <see cref="Topic.BaseTopic"/>, and confirms that <see cref="TrackedRecordCollection{TItem,
311+
/// TValue, TAttribute}.GetValue(String, Boolean)"/> correctly returns <c>null</c> if an incorrect <c>referencedKey</c> is
312312
/// entered.
313313
/// </summary>
314314
[TestMethod]
@@ -330,8 +330,8 @@ public void GetTopic_InheritedReference_ReturnsNull() {
330330
\-------------------------------------------------------------------------------------------------------------------------*/
331331
/// <summary>
332332
/// Assembles a new <see cref="TopicReferenceCollection"/> with a <see cref="Topic.BaseTopic"/>, adds a new <see cref="
333-
/// Topic"/> reference to the <see cref="Topic.BaseTopic"/>, and confirms that <see cref="TrackedCollection{TItem, TValue,
334-
/// TAttribute}.GetValue(String, Boolean)"/> correctly returns <c>null</c> if <c>inheritFromBase</c> is set to
333+
/// Topic"/> reference to the <see cref="Topic.BaseTopic"/>, and confirms that <see cref="TrackedRecordCollection{TItem,
334+
/// TValue, TAttribute}.GetValue(String, Boolean)"/> correctly returns <c>null</c> if <c>inheritFromBase</c> is set to
335335
/// <c>false</c>.
336336
/// </summary>
337337
[TestMethod]

0 commit comments

Comments
 (0)