1
0
mirror of https://github.com/oliverbooth/VPLink synced 2024-11-14 16:25:41 +00:00
VPLink/VPLink.Tests/DiscordConfigurationTests.cs

34 lines
1.0 KiB
C#
Raw Normal View History

2023-08-26 17:47:11 +01:00
using NSubstitute;
using NSubstitute.Extensions;
using VPLink.Common.Configuration;
using VPLink.Common.Services;
namespace VPLink.Tests;
public class DiscordConfigurationTests
{
private IConfigurationService _configurationService = null!;
[SetUp]
public void Setup()
{
var configuration = Substitute.For<IDiscordConfiguration>();
configuration.Token.Returns("DISCORD_TOKEN");
configuration.ChannelId.Returns(1234567890UL);
_configurationService = Substitute.For<IConfigurationService>();
_configurationService.Configure().DiscordConfiguration.Returns(configuration);
}
[Test]
public void DiscordConfiguration_ShouldReturnCorrectValues_GivenDefaultConfig()
{
IDiscordConfiguration configuration = _configurationService.DiscordConfiguration;
Assert.Multiple(() =>
{
Assert.That(configuration.Token, Is.EqualTo("DISCORD_TOKEN"));
Assert.That(configuration.ChannelId, Is.EqualTo(1234567890UL));
});
}
}