Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit f6826b5

Browse files
committed
Add test for new UriString.Filename property
1 parent f3bb2f8 commit f6826b5

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using GitHub.Unity;
2+
using NUnit.Framework;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Text;
7+
8+
namespace UnitTests.Primitives
9+
{
10+
[TestFixture]
11+
class UriStringTests
12+
{
13+
[TestCase("http://url.com/path/file.zip?cb=1", "file.zip")]
14+
[TestCase("http://url.com/path/file?cb=1", "file")]
15+
public void FilenameParsing(string url, string expectedFilename)
16+
{
17+
var uriString = new UriString(url);
18+
Assert.AreEqual(expectedFilename, uriString.Filename);
19+
}
20+
}
21+
}

src/tests/UnitTests/UnitTests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
<Compile Include="IO\LinuxBasedGitEnvironmentTests.cs" />
9494
<Compile Include="IO\WindowsGitEnvironmentTests.cs" />
9595
<Compile Include="IO\FileSystemHelperTests.cs" />
96+
<Compile Include="Primitives\UriStringTests.cs" />
9697
<Compile Include="ProcessManagerExtensions.cs" />
9798
<Compile Include="SetUpFixture.cs" />
9899
<Compile Include="Properties\AssemblyInfo.cs" />

0 commit comments

Comments
 (0)