2011-10-09 02:16:11 +00:00
|
|
|
|
using FluentAssertions;
|
|
|
|
|
using Moq;
|
|
|
|
|
using NUnit.Framework;
|
2011-10-09 17:45:08 +00:00
|
|
|
|
using NzbDrone.Model;
|
2011-10-09 02:16:11 +00:00
|
|
|
|
using NzbDrone.Providers;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.App.Test
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class ProgramTest
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
[TestCase(null, ApplicationMode.Console)]
|
|
|
|
|
[TestCase("", ApplicationMode.Console)]
|
|
|
|
|
[TestCase("1", ApplicationMode.Help)]
|
|
|
|
|
[TestCase("ii", ApplicationMode.Help)]
|
|
|
|
|
[TestCase("uu", ApplicationMode.Help)]
|
|
|
|
|
[TestCase("i", ApplicationMode.InstallService)]
|
|
|
|
|
[TestCase("I", ApplicationMode.InstallService)]
|
|
|
|
|
[TestCase("/I", ApplicationMode.InstallService)]
|
|
|
|
|
[TestCase("/i", ApplicationMode.InstallService)]
|
|
|
|
|
[TestCase("-I", ApplicationMode.InstallService)]
|
|
|
|
|
[TestCase("-i", ApplicationMode.InstallService)]
|
|
|
|
|
[TestCase("u", ApplicationMode.UninstallService)]
|
|
|
|
|
[TestCase("U", ApplicationMode.UninstallService)]
|
|
|
|
|
[TestCase("/U", ApplicationMode.UninstallService)]
|
|
|
|
|
[TestCase("/u", ApplicationMode.UninstallService)]
|
|
|
|
|
[TestCase("-U", ApplicationMode.UninstallService)]
|
|
|
|
|
[TestCase("-u", ApplicationMode.UninstallService)]
|
|
|
|
|
public void GetApplicationMode_single_arg(string arg, ApplicationMode mode)
|
|
|
|
|
{
|
2011-10-11 07:11:05 +00:00
|
|
|
|
NzbDroneConsole.GetApplicationMode(new[] { arg }).Should().Be(mode);
|
2011-10-09 02:16:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestCase("", "", ApplicationMode.Console)]
|
|
|
|
|
[TestCase("", null, ApplicationMode.Console)]
|
|
|
|
|
[TestCase("i", "n", ApplicationMode.Help)]
|
|
|
|
|
public void GetApplicationMode_two_args(string a, string b, ApplicationMode mode)
|
|
|
|
|
{
|
2011-10-11 07:11:05 +00:00
|
|
|
|
NzbDroneConsole.GetApplicationMode(new[] { a, b }).Should().Be(mode);
|
2011-10-09 02:16:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|