@@ -14,48 +14,40 @@ namespace UnitTest_redmine_net40_api
1414 [ TestClass ]
1515 public class TrackerTests
1616 {
17- #region Constants
18- private const int numberOfTrackers = 2 ;
19- #endregion Constants
20-
21- #region Properties
2217 private RedmineManager redmineManager ;
23- private string uri ;
24- private string apiKey ;
25- #endregion Properties
2618
27- #region Initialize
19+ private const int NUMBER_OF_TRACKERS = 3 ;
20+
2821 [ TestInitialize ]
2922 public void Initialize ( )
3023 {
31- uri = ConfigurationManager . AppSettings [ "uri" ] ;
32- apiKey = ConfigurationManager . AppSettings [ "apiKey" ] ;
33-
3424 SetMimeTypeJSON ( ) ;
3525 SetMimeTypeXML ( ) ;
3626 }
3727
3828 [ Conditional ( "JSON" ) ]
3929 private void SetMimeTypeJSON ( )
4030 {
41- redmineManager = new RedmineManager ( uri , apiKey , MimeFormat . json ) ;
31+ redmineManager = new RedmineManager ( Helper . Uri , Helper . ApiKey , MimeFormat . json ) ;
4232 }
4333
4434 [ Conditional ( "XML" ) ]
4535 private void SetMimeTypeXML ( )
4636 {
47- redmineManager = new RedmineManager ( uri , apiKey , MimeFormat . xml ) ;
37+ redmineManager = new RedmineManager ( Helper . Uri , Helper . ApiKey , MimeFormat . xml ) ;
4838 }
49- #endregion Initialize
5039
51- #region Tests
5240 [ TestMethod ]
5341 public void RedmineTrackers_ShouldGetAllTrackers ( )
5442 {
5543 var trackers = redmineManager . GetObjects < Tracker > ( null ) ;
5644
57- Assert . IsTrue ( trackers . Count == numberOfTrackers ) ;
45+ Assert . IsNotNull ( trackers , "Get all trackers returned null" ) ;
46+ Assert . IsTrue ( trackers . Count == NUMBER_OF_TRACKERS , "Trackers count != " + NUMBER_OF_TRACKERS ) ;
47+ CollectionAssert . AllItemsAreNotNull ( trackers , "Trackers list contains null items." ) ;
48+ CollectionAssert . AllItemsAreUnique ( trackers , "Trackers items are not unique." ) ;
49+ CollectionAssert . AllItemsAreInstancesOfType ( trackers , typeof ( Tracker ) , "Not all items are of type Tracker." ) ;
50+
5851 }
59- #endregion Tests
6052 }
6153}
0 commit comments