Skip to content

Commit dfc0e3b

Browse files
committed
Moved NamedTopicCollection declaration to the top of each test
This is totally unnecessary, but I prefer defining the top-level object first, and then the child objects second so that the code is easier to assess.
1 parent d7865b6 commit dfc0e3b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

OnTopic.Tests/NamedTopicCollection.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public class NamedTopicCollectionTest {
2929
[TestMethod]
3030
public void AddTopic_IsDirty() {
3131

32-
var related = TopicFactory.Create("Topic", "Page");
3332
var relationships = new NamedTopicCollection("Test");
33+
var related = TopicFactory.Create("Topic", "Page");
3434

3535
relationships.Add(related);
3636

@@ -48,9 +48,9 @@ public void AddTopic_IsDirty() {
4848
[TestMethod]
4949
public void AddTopic_IsDuplicate_IsNotDirty() {
5050

51+
var relationships = new NamedTopicCollection("Test");
5152
var related1 = TopicFactory.Create("Topic", "Page");
5253
var related2 = TopicFactory.Create("Topic", "Page");
53-
var relationships = new NamedTopicCollection("Test");
5454

5555
relationships.Add(related1);
5656
relationships.IsDirty = false;
@@ -76,9 +76,9 @@ public void AddTopic_IsDuplicate_IsNotDirty() {
7676
[TestMethod]
7777
public void AddTopic_IsDuplicate_StaysDirty() {
7878

79+
var relationships = new NamedTopicCollection("Test");
7980
var related1 = TopicFactory.Create("Topic", "Page");
8081
var related2 = TopicFactory.Create("Topic", "Page");
81-
var relationships = new NamedTopicCollection("Test");
8282

8383
relationships.Add(related1);
8484

@@ -104,8 +104,8 @@ public void AddTopic_IsDuplicate_StaysDirty() {
104104
[TestMethod]
105105
public void RemoveTopic_IsDirty() {
106106

107-
var related = TopicFactory.Create("Topic", "Page");
108107
var relationships = new NamedTopicCollection("Test");
108+
var related = TopicFactory.Create("Topic", "Page");
109109

110110
relationships.Add(related);
111111
relationships.IsDirty = false;
@@ -144,9 +144,9 @@ public void RemoveTopic_MissingTopic_IsNotDirty() {
144144
[TestMethod]
145145
public void RemoveTopic_MissingTopic_StaysDirty() {
146146

147+
var relationships = new NamedTopicCollection("Test");
147148
var related = TopicFactory.Create("Topic1", "Page");
148149
var missing = TopicFactory.Create("Topic2", "Page");
149-
var relationships = new NamedTopicCollection("Test");
150150

151151
relationships.Add(related);
152152
relationships.Remove(missing);
@@ -165,8 +165,8 @@ public void RemoveTopic_MissingTopic_StaysDirty() {
165165
[TestMethod]
166166
public void Clear_ExistingTopics_IsDirty() {
167167

168-
var related = TopicFactory.Create("Topic", "Page");
169168
var relationships = new NamedTopicCollection("Test");
169+
var related = TopicFactory.Create("Topic", "Page");
170170

171171
relationships.Add(related);
172172
relationships.IsDirty = false;

0 commit comments

Comments
 (0)