@@ -51,6 +51,13 @@ public void CanCreateStandardRepo()
51
51
}
52
52
}
53
53
54
+ [ Test ]
55
+ public void CreatingRepoWithBadParamsThrows ( )
56
+ {
57
+ Assert . Throws < ArgumentException > ( ( ) => Repository . Init ( string . Empty ) ) ;
58
+ Assert . Throws < ArgumentNullException > ( ( ) => Repository . Init ( null ) ) ;
59
+ }
60
+
54
61
private static void AssertInitializedRepository ( Repository repo )
55
62
{
56
63
repo . Info . Path . ShouldNotBeNull ( ) ;
@@ -76,11 +83,51 @@ private static void AssertInitializedRepository(Repository repo)
76
83
repo . Tags . Count ( ) . ShouldEqual ( 0 ) ;
77
84
}
78
85
86
+
79
87
[ Test ]
80
- public void CreatingRepoWithBadParamsThrows ( )
88
+ public void CanOpenRepoWithFullPath ( )
81
89
{
82
- Assert . Throws < ArgumentException > ( ( ) => Repository . Init ( string . Empty ) ) ;
83
- Assert . Throws < ArgumentNullException > ( ( ) => Repository . Init ( null ) ) ;
90
+ var path = Path . GetFullPath ( Constants . BareTestRepoPath ) ;
91
+ using ( var repo = new Repository ( path ) )
92
+ {
93
+ repo . ShouldNotBeNull ( ) ;
94
+ }
95
+ }
96
+
97
+ [ Test ]
98
+ [ Platform ( Exclude = "Linux,Unix" , Reason = "No need to test windows path separators on non-windows platforms" ) ]
99
+ // See http://www.nunit.org/index.php?p=platform&r=2.6 for other platforms that can be excluded/included.
100
+ public void CanOpenRepoWithWindowsPathSeparators ( )
101
+ {
102
+ using ( new Repository ( @".\Resources\testrepo.git" ) )
103
+ {
104
+ }
105
+ }
106
+
107
+ [ Test ]
108
+ public void CanOpenRepository ( )
109
+ {
110
+ using ( var repo = new Repository ( Constants . BareTestRepoPath ) )
111
+ {
112
+ repo . Info . Path . ShouldNotBeNull ( ) ;
113
+ repo . Info . WorkingDirectory . ShouldBeNull ( ) ;
114
+ repo . Info . IsBare . ShouldBeTrue ( ) ;
115
+ repo . Info . IsEmpty . ShouldBeFalse ( ) ;
116
+ repo . Info . IsHeadDetached . ShouldBeFalse ( ) ;
117
+ }
118
+ }
119
+
120
+ [ Test ]
121
+ public void OpeningNonExistentRepoThrows ( )
122
+ {
123
+ Assert . Throws < ApplicationException > ( ( ) => { new Repository ( "a_bad_path" ) ; } ) ;
124
+ }
125
+
126
+ [ Test ]
127
+ public void OpeningRepositoryWithBadParamsThrows ( )
128
+ {
129
+ Assert . Throws < ArgumentException > ( ( ) => new Repository ( string . Empty ) ) ;
130
+ Assert . Throws < ArgumentNullException > ( ( ) => new Repository ( null ) ) ;
84
131
}
85
132
86
133
[ Test ]
@@ -139,15 +186,6 @@ public void CanLookupSameObjectTwiceAndTheyAreEqual()
139
186
}
140
187
}
141
188
142
- [ Test ]
143
- public void CanOpenRepoWithFullPath ( )
144
- {
145
- var path = Path . GetFullPath ( Constants . BareTestRepoPath ) ;
146
- using ( new Repository ( path ) )
147
- {
148
- }
149
- }
150
-
151
189
[ Test ]
152
190
public void LookupObjectByWrongShaReturnsNull ( )
153
191
{
@@ -194,43 +232,7 @@ public void LookingUpWithBadParamsThrows()
194
232
}
195
233
196
234
[ Test ]
197
- [ Platform ( Exclude = "Linux,Unix" , Reason = "No need to test windows path separators on non-windows platforms" ) ]
198
- // See http://www.nunit.org/index.php?p=platform&r=2.6 for other platforms that can be excluded/included.
199
- public void CanOpenRepoWithWindowsPathSeparators ( )
200
- {
201
- using ( new Repository ( @".\Resources\testrepo.git" ) )
202
- {
203
- }
204
- }
205
-
206
- [ Test ]
207
- public void CanOpenRepository ( )
208
- {
209
- using ( var repo = new Repository ( Constants . BareTestRepoPath ) )
210
- {
211
- repo . Info . Path . ShouldNotBeNull ( ) ;
212
- repo . Info . WorkingDirectory . ShouldBeNull ( ) ;
213
- repo . Info . IsBare . ShouldBeTrue ( ) ;
214
- repo . Info . IsEmpty . ShouldBeFalse ( ) ;
215
- repo . Info . IsHeadDetached . ShouldBeFalse ( ) ;
216
- }
217
- }
218
-
219
- [ Test ]
220
- public void OpenNonExistentRepoThrows ( )
221
- {
222
- Assert . Throws < ApplicationException > ( ( ) => { new Repository ( "a_bad_path" ) ; } ) ;
223
- }
224
-
225
- [ Test ]
226
- public void OpeningRepositoryWithBadParamsThrows ( )
227
- {
228
- Assert . Throws < ArgumentException > ( ( ) => new Repository ( string . Empty ) ) ;
229
- Assert . Throws < ArgumentNullException > ( ( ) => new Repository ( null ) ) ;
230
- }
231
-
232
- [ Test ]
233
- public void CanTellIfObjectsExistInRepository ( )
235
+ public void CanCheckForObjectExistence ( )
234
236
{
235
237
using ( var repo = new Repository ( Constants . BareTestRepoPath ) )
236
238
{
0 commit comments