-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCommandHandlerTests.cs
46 lines (43 loc) · 1.47 KB
/
CommandHandlerTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using Xunit;
using DiscordScraperBot.Discord;
using DiscordScraperBot;
namespace DiscordScraperBot.UnitTests
{
public class CommandHandlerTests
{
public class InitializeCommandHandlerTests
{
/*
* The ScraperManager being equal to null is not detrimental to the
* initialization of the InitializeCommandHandler context class.
*/
[Fact]
public void TestNullScraperManager()
{
Bot bot = new Bot();
ScraperManager scraper_manager = new ScraperManager(bot);
Preferences preferences = new Preferences(new MockStorage());
InitializeCommandHandler init = new InitializeCommandHandler(scraper_manager, bot, preferences);
Assert.NotNull(init.Client);
Assert.NotNull(init.Commands);
Assert.NotNull(init.Services);
}
}
public class CommandHandlerClassTests
{
/*
* The InitializeCommandHandler argument cannot be null because it is used
* to initialize the CommandHandler object.
*/
[Fact]
public void TestNullInitializeCommandHandler()
{
Assert.Throws<ArgumentNullException>(() =>
{
CommandHandler command_handler = new CommandHandler(null);
});
}
}
}
}