|
| 1 | +using System; |
1 | 2 | using SabreTools.RedumpLib.Data; |
2 | 3 | using SabreTools.RedumpLib.Web; |
3 | 4 | using Xunit; |
@@ -118,7 +119,32 @@ public void BuildNewDiscUrl_AlwaysPositive(int id, int expected) |
118 | 119 |
|
119 | 120 | #region BuildPackUrl |
120 | 121 |
|
121 | | - // TODO: Implement |
| 122 | + [Theory] |
| 123 | + [InlineData(PackType.Cuesheets, "http://redump.org/cues/arch/")] |
| 124 | + [InlineData(PackType.Datfile, "http://redump.org/datfile/arch/")] |
| 125 | + [InlineData(PackType.DecryptedKeys, "http://redump.org/dkeys/arch/")] |
| 126 | + [InlineData(PackType.Gdis, "http://redump.org/gdi/arch/")] |
| 127 | + [InlineData(PackType.Keys, "http://redump.org/keys/arch/")] |
| 128 | + [InlineData(PackType.Lsds, "http://redump.org/lsd/arch/")] |
| 129 | + [InlineData(PackType.Sbis, "http://redump.org/sbi/arch/")] |
| 130 | + public void BuildPackUrl_ValidPackType_ValidSystem_Builds(PackType packType, string expected) |
| 131 | + { |
| 132 | + string actual = UrlBuilder.BuildPackUrl(packType, RedumpSystem.AcornArchimedes); |
| 133 | + Assert.Equal(expected, actual); |
| 134 | + } |
| 135 | + |
| 136 | + [Fact] |
| 137 | + public void BuildPackUrl_InvalidPackType_Throws() |
| 138 | + { |
| 139 | + Assert.Throws<ArgumentOutOfRangeException>(() => UrlBuilder.BuildPackUrl((PackType)int.MaxValue, RedumpSystem.AcornArchimedes)); |
| 140 | + } |
| 141 | + |
| 142 | + [Fact] |
| 143 | + public void BuildPackUrl_InvalidSystem_Builds() |
| 144 | + { |
| 145 | + string actual = UrlBuilder.BuildPackUrl(PackType.Datfile, RedumpSystem.MarkerOtherEnd); |
| 146 | + Assert.Equal("http://redump.org/datfile//", actual); |
| 147 | + } |
122 | 148 |
|
123 | 149 | #endregion |
124 | 150 | } |
|
0 commit comments