@@ -14,7 +14,7 @@ public class InventoryManagerTests
1414 [ TestInitialize ]
1515 public void Setup ( )
1616 {
17- TestContentLoader . Load ( ) ;
17+ SandboxContent . Load ( ) ;
1818 _items = ContentHost . GetContent < Items > ( ) ;
1919 _gameStore = new GameStore ( ) ;
2020 _inventoryManager = new InventoryManager ( _gameStore ) ;
@@ -23,8 +23,8 @@ public void Setup()
2323 [ TestMethod ]
2424 public void InventoryManager_AddsAndRemovesItems_Correctly ( )
2525 {
26- var potion = _items ! . All . First ( x => x . Name == " Potion" ) ;
27- var basicGem = _items ! . All . First ( x => x . Name == "Basic Gem" ) ;
26+ var potion = _items ! . All . First ( x => x . Name == SandboxContent . Potion ) ;
27+ var basicGem = _items ! . All . First ( x => x . Name == SandboxContent . BasicGem ) ;
2828
2929 // Act
3030 _inventoryManager ! . Add ( potion , 5 ) ;
@@ -45,7 +45,7 @@ public void InventoryManager_AddsAndRemovesItems_Correctly()
4545 [ TestMethod ]
4646 public void InventoryManager_Remove_FailsWhenInsufficient ( )
4747 {
48- var potion = _items ! . All . First ( x => x . Name == " Potion" ) ;
48+ var potion = _items ! . All . First ( x => x . Name == SandboxContent . Potion ) ;
4949
5050 _inventoryManager ! . Add ( potion , 5 ) ;
5151 var result = _inventoryManager . Remove ( potion , 10 ) ;
@@ -57,7 +57,7 @@ public void InventoryManager_Remove_FailsWhenInsufficient()
5757 [ TestMethod ]
5858 public void InventoryManager_Remove_RemovesFromDictionaryWhenZero ( )
5959 {
60- var potion = _items ! . All . First ( x => x . Name == " Potion" ) ;
60+ var potion = _items ! . All . First ( x => x . Name == SandboxContent . Potion ) ;
6161
6262 _inventoryManager ! . Add ( potion , 5 ) ;
6363 _inventoryManager . Remove ( potion , 5 ) ;
@@ -69,7 +69,7 @@ public void InventoryManager_Remove_RemovesFromDictionaryWhenZero()
6969 [ TestMethod ]
7070 public void InventoryManager_Remove_DoesNotRemoveGoldWhenZero ( )
7171 {
72- var gold = _items ! . All . First ( x => x . Name == " Gold" ) ;
72+ var gold = _items ! . All . First ( x => x . Name == SandboxContent . Gold ) ;
7373
7474 _inventoryManager ! . Add ( gold , 5 ) ;
7575 _inventoryManager . Remove ( gold , 5 ) ;
@@ -80,8 +80,8 @@ public void InventoryManager_Remove_DoesNotRemoveGoldWhenZero()
8080 [ TestMethod ]
8181 public void InventoryManager_Has_Correctly ( )
8282 {
83- var potion = _items ! . All . First ( x => x . Name == " Potion" ) ;
84- var basicGem = _items ! . All . First ( x => x . Name == "Basic Gem" ) ;
83+ var potion = _items ! . All . First ( x => x . Name == SandboxContent . Potion ) ;
84+ var basicGem = _items ! . All . First ( x => x . Name == SandboxContent . BasicGem ) ;
8585
8686 // Act
8787 _inventoryManager ! . Add ( potion , 5 ) ;
@@ -95,8 +95,8 @@ public void InventoryManager_Has_Correctly()
9595 [ TestMethod ]
9696 public void InventoryManager_GetItemsAndSpells_FilterCorrectly ( )
9797 {
98- var potion = _items ! . All . First ( x => x . Name == " Potion" ) ;
99- var fire = _items ! . All . First ( x => x . Name == "Fire I" ) ;
98+ var potion = _items ! . All . First ( x => x . Name == SandboxContent . Potion ) ;
99+ var fire = _items ! . All . First ( x => x . Name == SandboxContent . FireI ) ;
100100
101101 _inventoryManager ! . Add ( potion , 1 ) ;
102102 _inventoryManager . Add ( fire , 1 ) ;
@@ -113,37 +113,37 @@ public void InventoryManager_GetItemsAndSpells_FilterCorrectly()
113113 [ TestMethod ]
114114 public void InventoryManager_GetQuantity_ReturnsZeroForMissingItem ( )
115115 {
116- var potion = _items ! . All . First ( x => x . Name == " Potion" ) ;
116+ var potion = _items ! . All . First ( x => x . Name == SandboxContent . Potion ) ;
117117 Assert . AreEqual ( 0 , _inventoryManager ! . GetQuantity ( potion ) ) ;
118118 }
119119
120120 [ TestMethod ]
121121 public void InventoryManager_Has_ReturnsTrueForZeroQuantity ( )
122122 {
123- var potion = _items ! . All . First ( x => x . Name == " Potion" ) ;
123+ var potion = _items ! . All . First ( x => x . Name == SandboxContent . Potion ) ;
124124 Assert . IsTrue ( _inventoryManager ! . Has ( potion , 0 ) ) ;
125125 }
126126
127127 [ TestMethod ]
128128 public void InventoryManager_Add_DoesNothingWithZeroQuantity ( )
129129 {
130- var potion = _items ! . All . First ( x => x . Name == " Potion" ) ;
130+ var potion = _items ! . All . First ( x => x . Name == SandboxContent . Potion ) ;
131131 _inventoryManager ! . Add ( potion , 0 ) ;
132132 Assert . AreEqual ( 0 , _inventoryManager . GetQuantity ( potion ) ) ;
133133 }
134134
135135 [ TestMethod ]
136136 public void InventoryManager_Add_NegativeQuantity_DoesNothing ( )
137137 {
138- var potion = _items ! . All . First ( x => x . Name == " Potion" ) ;
138+ var potion = _items ! . All . First ( x => x . Name == SandboxContent . Potion ) ;
139139 _inventoryManager ! . Add ( potion , - 10 ) ;
140140 Assert . AreEqual ( 0 , _inventoryManager . GetQuantity ( potion ) ) ;
141141 }
142142
143143 [ TestMethod ]
144144 public void InventoryManager_Remove_NegativeQuantity_ReturnsTrueAndDoesNothing ( )
145145 {
146- var potion = _items ! . All . First ( x => x . Name == " Potion" ) ;
146+ var potion = _items ! . All . First ( x => x . Name == SandboxContent . Potion ) ;
147147 _inventoryManager ! . Add ( potion , 5 ) ;
148148 var result = _inventoryManager . Remove ( potion , - 5 ) ;
149149 Assert . IsTrue ( result ) ;
@@ -153,7 +153,7 @@ public void InventoryManager_Remove_NegativeQuantity_ReturnsTrueAndDoesNothing()
153153 [ TestMethod ]
154154 public void InventoryManager_MagicCapacity_Enforcement ( )
155155 {
156- var fire = _items ! . All . First ( x => x . Name == "Fire I" ) ;
156+ var fire = _items ! . All . First ( x => x . Name == SandboxContent . FireI ) ;
157157 _gameStore ! . Dispatch ( new SetMagicCapacityAction ( 30 ) ) ;
158158
159159 // Try adding 100
@@ -165,28 +165,28 @@ public void InventoryManager_MagicCapacity_Enforcement()
165165 [ TestMethod ]
166166 public void InventoryManager_Pinning_Works ( )
167167 {
168- var potion = _items ! . All . First ( x => x . Name == " Potion" ) ;
168+ var potion = _items ! . All . First ( x => x . Name == SandboxContent . Potion ) ;
169169
170- Assert . IsFalse ( _inventoryManager ! . IsPinned ( " Potion" ) ) ;
170+ Assert . IsFalse ( _inventoryManager ! . IsPinned ( SandboxContent . Potion ) ) ;
171171
172- _inventoryManager . TogglePin ( " Potion" ) ;
173- Assert . IsTrue ( _inventoryManager . IsPinned ( " Potion" ) ) ;
172+ _inventoryManager . TogglePin ( SandboxContent . Potion ) ;
173+ Assert . IsTrue ( _inventoryManager . IsPinned ( SandboxContent . Potion ) ) ;
174174
175175 _inventoryManager . Add ( potion , 5 ) ;
176176 var pinned = _inventoryManager . GetPinnedItems ( ) . ToList ( ) ;
177177 Assert . AreEqual ( 1 , pinned . Count ) ;
178- Assert . AreEqual ( " Potion" , pinned [ 0 ] . Item . Name ) ;
178+ Assert . AreEqual ( SandboxContent . Potion , pinned [ 0 ] . Item . Name ) ;
179179 Assert . AreEqual ( 5 , pinned [ 0 ] . Quantity ) ;
180180
181- _inventoryManager . TogglePin ( " Potion" ) ;
182- Assert . IsFalse ( _inventoryManager . IsPinned ( " Potion" ) ) ;
181+ _inventoryManager . TogglePin ( SandboxContent . Potion ) ;
182+ Assert . IsFalse ( _inventoryManager . IsPinned ( SandboxContent . Potion ) ) ;
183183 Assert . AreEqual ( 0 , _inventoryManager . GetPinnedItems ( ) . Count ( ) ) ;
184184 }
185185
186186 [ TestMethod ]
187187 public void InventoryManager_Clear_Works ( )
188188 {
189- var potion = _items ! . All . First ( x => x . Name == " Potion" ) ;
189+ var potion = _items ! . All . First ( x => x . Name == SandboxContent . Potion ) ;
190190
191191 _inventoryManager ! . Add ( potion , 5 ) ;
192192 Assert . AreEqual ( 5 , _inventoryManager . GetQuantity ( potion ) ) ;
@@ -199,7 +199,7 @@ public void InventoryManager_Clear_Works()
199199 [ TestMethod ]
200200 public void InventoryManager_Subtract_Works ( )
201201 {
202- var potion = _items ! . All . First ( x => x . Name == " Potion" ) ;
202+ var potion = _items ! . All . First ( x => x . Name == SandboxContent . Potion ) ;
203203
204204 _inventoryManager ! . Add ( potion , 10 ) ;
205205 _inventoryManager . Remove ( potion , 4 ) ;
0 commit comments