This repository has been archived by the owner on Jun 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
55 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using FluentAssertions; | ||
using ModSink.Common.Models; | ||
using Xunit; | ||
|
||
namespace ModSink.Common.Tests.Models | ||
{ | ||
public class WithBaseUriTests | ||
{ | ||
[Theory] | ||
[InlineData("http://example.com/group.bin", "Repo/repo.bin", "http://example.com/Repo/repo.bin")] | ||
[InlineData("http://example.com/Repo/repo.bin","Modpack/Mod/File.bin", "http://example.com/Repo/Modpack/Mod/File.bin")] | ||
public void CombinesCorrectly(string @base, string relative, string expected) | ||
{ | ||
var withBaseUri = new WithBaseUriTestClass(){BaseUri = new Uri(@base) }; | ||
var actual = withBaseUri.CombineBaseUri(new Uri(relative,UriKind.Relative)); | ||
actual.Should().Be(new Uri(expected)); | ||
} | ||
private class WithBaseUriTestClass : WithBaseUri | ||
{ | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
|
||
namespace ModSink.Common.Models | ||
{ | ||
[Serializable] | ||
public abstract class WithBaseUri | ||
{ | ||
public Uri BaseUri { get; set; } | ||
|
||
public Uri CombineBaseUri(Uri relative) | ||
{ | ||
return new Uri(BaseUri, relative); | ||
} | ||
} | ||
} |