fix: rename client related classes to be specific to gateway
This commit is contained in:
+7
-7
@@ -1,24 +1,24 @@
|
|||||||
namespace StevesBot.Worker.Tests.Unit;
|
namespace StevesBot.Worker.Tests.Unit;
|
||||||
|
|
||||||
public class DiscordClientExceptionTests
|
public class DiscordGatewayClientExceptionTests
|
||||||
{
|
{
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Constructor_WhenCalledWithoutParameters_ItShouldCreateInstance()
|
public void Constructor_WhenCalledWithoutParameters_ItShouldCreateInstance()
|
||||||
{
|
{
|
||||||
var exception = new DiscordClientException();
|
var exception = new DiscordGatewayClientException();
|
||||||
|
|
||||||
exception.Should().NotBeNull();
|
exception.Should().NotBeNull();
|
||||||
exception.Should().BeOfType<DiscordClientException>();
|
exception.Should().BeOfType<DiscordGatewayClientException>();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Constructor_WhenCalledWithMessage_ItShouldCreateInstance()
|
public void Constructor_WhenCalledWithMessage_ItShouldCreateInstance()
|
||||||
{
|
{
|
||||||
var message = "Test message";
|
var message = "Test message";
|
||||||
var exception = new DiscordClientException(message);
|
var exception = new DiscordGatewayClientException(message);
|
||||||
|
|
||||||
exception.Should().NotBeNull();
|
exception.Should().NotBeNull();
|
||||||
exception.Should().BeOfType<DiscordClientException>();
|
exception.Should().BeOfType<DiscordGatewayClientException>();
|
||||||
exception.Message.Should().Be(message);
|
exception.Message.Should().Be(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,10 +27,10 @@ public class DiscordClientExceptionTests
|
|||||||
{
|
{
|
||||||
var message = "Test message";
|
var message = "Test message";
|
||||||
var innerException = new Exception("Inner exception");
|
var innerException = new Exception("Inner exception");
|
||||||
var exception = new DiscordClientException(message, innerException);
|
var exception = new DiscordGatewayClientException(message, innerException);
|
||||||
|
|
||||||
exception.Should().NotBeNull();
|
exception.Should().NotBeNull();
|
||||||
exception.Should().BeOfType<DiscordClientException>();
|
exception.Should().BeOfType<DiscordGatewayClientException>();
|
||||||
exception.Message.Should().Be(message);
|
exception.Message.Should().Be(message);
|
||||||
exception.InnerException.Should().Be(innerException);
|
exception.InnerException.Should().Be(innerException);
|
||||||
}
|
}
|
||||||
+5
-5
@@ -1,14 +1,14 @@
|
|||||||
namespace StevesBot.Worker.Tests.Unit;
|
namespace StevesBot.Worker.Tests.Unit;
|
||||||
|
|
||||||
public class DiscordClientOptionsTests
|
public class DiscordGatewayClientOptionsTests
|
||||||
{
|
{
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Constructor_WhenCalledWithoutParameters_ItShouldCreateInstance()
|
public void Constructor_WhenCalledWithoutParameters_ItShouldCreateInstance()
|
||||||
{
|
{
|
||||||
var options = new DiscordClientOptions();
|
var options = new DiscordGatewayClientOptions();
|
||||||
|
|
||||||
options.Should().NotBeNull();
|
options.Should().NotBeNull();
|
||||||
options.Should().BeOfType<DiscordClientOptions>();
|
options.Should().BeOfType<DiscordGatewayClientOptions>();
|
||||||
options.ApiUrl.Should().Be(string.Empty);
|
options.ApiUrl.Should().Be(string.Empty);
|
||||||
options.AppToken.Should().Be(string.Empty);
|
options.AppToken.Should().Be(string.Empty);
|
||||||
options.Intents.Should().Be(0);
|
options.Intents.Should().Be(0);
|
||||||
@@ -21,7 +21,7 @@ public class DiscordClientOptionsTests
|
|||||||
var appToken = "test-token";
|
var appToken = "test-token";
|
||||||
var intents = 123;
|
var intents = 123;
|
||||||
|
|
||||||
var options = new DiscordClientOptions
|
var options = new DiscordGatewayClientOptions
|
||||||
{
|
{
|
||||||
ApiUrl = apiUrl,
|
ApiUrl = apiUrl,
|
||||||
AppToken = appToken,
|
AppToken = appToken,
|
||||||
@@ -29,7 +29,7 @@ public class DiscordClientOptionsTests
|
|||||||
};
|
};
|
||||||
|
|
||||||
options.Should().NotBeNull();
|
options.Should().NotBeNull();
|
||||||
options.Should().BeOfType<DiscordClientOptions>();
|
options.Should().BeOfType<DiscordGatewayClientOptions>();
|
||||||
options.ApiUrl.Should().Be(apiUrl);
|
options.ApiUrl.Should().Be(apiUrl);
|
||||||
options.AppToken.Should().Be(appToken);
|
options.AppToken.Should().Be(appToken);
|
||||||
options.Intents.Should().Be(intents);
|
options.Intents.Should().Be(intents);
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
namespace StevesBot.Worker.Discord;
|
|
||||||
|
|
||||||
internal sealed class DiscordClientException : Exception
|
|
||||||
{
|
|
||||||
public DiscordClientException()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public DiscordClientException(string message) : base(message)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public DiscordClientException(string message, Exception innerException) : base(message, innerException)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
namespace StevesBot.Worker.Discord;
|
||||||
|
|
||||||
|
internal sealed class DiscordGatewayClientException : Exception
|
||||||
|
{
|
||||||
|
public DiscordGatewayClientException()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public DiscordGatewayClientException(string message) : base(message)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public DiscordGatewayClientException(string message, Exception innerException) : base(message, innerException)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
namespace StevesBot.Worker.Discord;
|
namespace StevesBot.Worker.Discord;
|
||||||
|
|
||||||
internal sealed class DiscordClientOptions
|
internal sealed class DiscordGatewayClientOptions
|
||||||
{
|
{
|
||||||
public string ApiUrl { get; init; } = string.Empty;
|
public string ApiUrl { get; init; } = string.Empty;
|
||||||
public string AppToken { get; init; } = string.Empty;
|
public string AppToken { get; init; } = string.Empty;
|
||||||
Reference in New Issue
Block a user