From 42b3a4c261c131bf69d36c34c787c2c20761ea22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20B=20Nagy?= <20251272+BNAndras@users.noreply.github.com> Date: Sat, 25 Jul 2026 11:52:37 -0700 Subject: [PATCH] `ArgumentException` -> `ArgumentOutOfRangeException` --- .../practice/all-your-base/.meta/Example.vb | 4 ++-- .../practice/all-your-base/AllYourBaseTests.vb | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/exercises/practice/all-your-base/.meta/Example.vb b/exercises/practice/all-your-base/.meta/Example.vb index 035d90e9..7957c770 100644 --- a/exercises/practice/all-your-base/.meta/Example.vb +++ b/exercises/practice/all-your-base/.meta/Example.vb @@ -3,12 +3,12 @@ Imports System.Collections.Generic Public Module AllYourBase Public Function Rebase(ByVal inputBase As Integer, ByVal inputDigits As Integer(), ByVal outputBase As Integer) As Integer() - If outputBase <= 1 OrElse inputBase <= 1 Then Throw New ArgumentException() + If outputBase <= 1 OrElse inputBase <= 1 Then Throw New ArgumentOutOfRangeException() Dim inputValue = 0 Dim exponent = 0, place = inputDigits.Length - 1 While exponent < inputDigits.Length - If inputDigits(place) < 0 OrElse inputDigits(place) >= inputBase Then Throw New ArgumentException() + If inputDigits(place) < 0 OrElse inputDigits(place) >= inputBase Then Throw New ArgumentOutOfRangeException() inputValue += inputDigits(place) * CInt(Math.Pow(inputBase, exponent)) exponent += 1 place -= 1 diff --git a/exercises/practice/all-your-base/AllYourBaseTests.vb b/exercises/practice/all-your-base/AllYourBaseTests.vb index 53a1bb4a..017a9a49 100644 --- a/exercises/practice/all-your-base/AllYourBaseTests.vb +++ b/exercises/practice/all-your-base/AllYourBaseTests.vb @@ -126,7 +126,7 @@ Public Class AllYourBaseTests Dim inputBase = 1 Dim digits = {0} Dim outputBase = 10 - Assert.Throws(Of ArgumentException)(Function() Rebase(inputBase, digits, outputBase)) + Assert.Throws(Of ArgumentOutOfRangeException)(Function() Rebase(inputBase, digits, outputBase)) End Sub @@ -134,7 +134,7 @@ Public Class AllYourBaseTests Dim inputBase = 0 Dim digits = Array.Empty(Of Integer)() Dim outputBase = 10 - Assert.Throws(Of ArgumentException)(Function() Rebase(inputBase, digits, outputBase)) + Assert.Throws(Of ArgumentOutOfRangeException)(Function() Rebase(inputBase, digits, outputBase)) End Sub @@ -142,7 +142,7 @@ Public Class AllYourBaseTests Dim inputBase = -2 Dim digits = {1} Dim outputBase = 10 - Assert.Throws(Of ArgumentException)(Function() Rebase(inputBase, digits, outputBase)) + Assert.Throws(Of ArgumentOutOfRangeException)(Function() Rebase(inputBase, digits, outputBase)) End Sub @@ -150,7 +150,7 @@ Public Class AllYourBaseTests Dim inputBase = 2 Dim digits = {1, -1, 1, 0, 1, 0} Dim outputBase = 10 - Assert.Throws(Of ArgumentException)(Function() Rebase(inputBase, digits, outputBase)) + Assert.Throws(Of ArgumentOutOfRangeException)(Function() Rebase(inputBase, digits, outputBase)) End Sub @@ -158,7 +158,7 @@ Public Class AllYourBaseTests Dim inputBase = 2 Dim digits = {1, 2, 1, 0, 1, 0} Dim outputBase = 10 - Assert.Throws(Of ArgumentException)(Function() Rebase(inputBase, digits, outputBase)) + Assert.Throws(Of ArgumentOutOfRangeException)(Function() Rebase(inputBase, digits, outputBase)) End Sub @@ -166,7 +166,7 @@ Public Class AllYourBaseTests Dim inputBase = 2 Dim digits = {1, 0, 1, 0, 1, 0} Dim outputBase = 1 - Assert.Throws(Of ArgumentException)(Function() Rebase(inputBase, digits, outputBase)) + Assert.Throws(Of ArgumentOutOfRangeException)(Function() Rebase(inputBase, digits, outputBase)) End Sub @@ -174,7 +174,7 @@ Public Class AllYourBaseTests Dim inputBase = 10 Dim digits = {7} Dim outputBase = 0 - Assert.Throws(Of ArgumentException)(Function() Rebase(inputBase, digits, outputBase)) + Assert.Throws(Of ArgumentOutOfRangeException)(Function() Rebase(inputBase, digits, outputBase)) End Sub @@ -182,7 +182,7 @@ Public Class AllYourBaseTests Dim inputBase = 2 Dim digits = {1} Dim outputBase = -7 - Assert.Throws(Of ArgumentException)(Function() Rebase(inputBase, digits, outputBase)) + Assert.Throws(Of ArgumentOutOfRangeException)(Function() Rebase(inputBase, digits, outputBase)) End Sub @@ -190,6 +190,6 @@ Public Class AllYourBaseTests Dim inputBase = -2 Dim digits = {1} Dim outputBase = -7 - Assert.Throws(Of ArgumentException)(Function() Rebase(inputBase, digits, outputBase)) + Assert.Throws(Of ArgumentOutOfRangeException)(Function() Rebase(inputBase, digits, outputBase)) End Sub End Class \ No newline at end of file