forked from git-tfs/git-tfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtTest.cs
More file actions
47 lines (45 loc) · 1.81 KB
/
Copy pathExtTest.cs
File metadata and controls
47 lines (45 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.IO;
using Rhino.Mocks;
using Sep.Git.Tfs.Commands;
using Sep.Git.Tfs.Core;
using Sep.Git.Tfs.Core.TfsInterop;
using StructureMap.AutoMocking;
using Xunit;
using Sep.Git.Tfs.Util;
namespace Sep.Git.Tfs.Test.Commands
{
public class ExtTest
{
[Fact]
public void AssertValidTfsPathTest()
{
Assert.DoesNotThrow(() => "$/test".AssertValidTfsPath());
Assert.Throws(typeof(GitTfsException), () => "$test".AssertValidTfsPath());
Assert.Throws(typeof(GitTfsException), () => "/test".AssertValidTfsPath());
Assert.Throws(typeof(GitTfsException), () => "test".AssertValidTfsPath());
}
[Fact]
public void ToGitRefNameTest()
{
Assert.Equal("test", "test".ToGitRefName());
Assert.Equal("test", "te^st".ToGitRefName());
Assert.Equal("test", "te~st".ToGitRefName());
Assert.Equal("test", "te st".ToGitRefName());
Assert.Equal("test", "te:st".ToGitRefName());
Assert.Equal("test", "te*st".ToGitRefName());
Assert.Equal("test", "te?st".ToGitRefName());
Assert.Equal("test", "te[st".ToGitRefName());
Assert.Equal("test", "test/".ToGitRefName());
Assert.Equal("test", "test.".ToGitRefName());
Assert.Equal("test", "te..st".ToGitRefName());
Assert.Equal("test", "test.".ToGitRefName());
Assert.Equal("test", "te\\st.".ToGitRefName());
Assert.Equal("test", "te@{st.".ToGitRefName());
Assert.Equal("test", "/test././".ToGitRefName());
Assert.Equal("bugs/nameOfTheBug", "/bu$gs/name:OfTheBug".ToGitRefName());
Assert.Equal("repo/test/test2", "$/repo/te:st/test2".ToGitRefName());
}
}
}