1
1
using System ;
2
+ using System . IO ;
2
3
using System . Linq ;
3
4
using LibGit2Sharp . Tests . TestHelpers ;
4
5
using Xunit ;
@@ -10,13 +11,14 @@ public class BranchFixture : BaseFixture
10
11
{
11
12
private readonly string [ ] expectedBranches = new [ ] { "br2" , "master" , "packed" , "packed-test" , "test" , } ;
12
13
13
- [ Fact ]
14
- public void CanCreateBranch ( )
14
+ [ Theory ]
15
+ [ InlineData ( "unit_test" ) ]
16
+ [ InlineData ( "Ångström" ) ]
17
+ public void CanCreateBranch ( string name )
15
18
{
16
19
TemporaryCloneOfTestRepo path = BuildTemporaryCloneOfTestRepo ( ) ;
17
20
using ( var repo = new Repository ( path . RepositoryPath ) )
18
21
{
19
- const string name = "unit_test" ;
20
22
Branch newBranch = repo . CreateBranch ( name , "be3563ae3f795b2b4353bcce3a527ad0a4f7f644" ) ;
21
23
newBranch . ShouldNotBeNull ( ) ;
22
24
newBranch . Name . ShouldEqual ( name ) ;
@@ -247,6 +249,22 @@ public void CanLookupLocalBranch()
247
249
}
248
250
}
249
251
252
+ [ Fact ]
253
+ public void CanLookupABranchWhichNameIsMadeOfNon7BitsAsciiCharacters ( )
254
+ {
255
+ TemporaryCloneOfTestRepo path = BuildTemporaryCloneOfTestRepo ( ) ;
256
+ using ( var repo = new Repository ( path . RepositoryPath ) )
257
+ {
258
+ const string name = "Ångström" ;
259
+ Branch newBranch = repo . CreateBranch ( name , "be3563a" ) ;
260
+ newBranch . ShouldNotBeNull ( ) ;
261
+
262
+ Branch retrieved = repo . Branches [ "Ångström" ] ;
263
+ retrieved . ShouldNotBeNull ( ) ;
<
107AA
/td>
264
+ retrieved . Tip . ShouldEqual ( newBranch . Tip ) ;
265
+ }
266
+ }
267
+
250
268
[ Fact ]
251
269
public void LookingOutABranchByNameWithBadParamsThrows ( )
252
270
{
0 commit comments