1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-28 10:37:41 +00:00
Lidarr/NzbDrone.Common.Test/EnvironmentTests/StartupArgumentsFixture.cs

42 lines
1.1 KiB
C#

using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Test.Common;
namespace NzbDrone.Common.Test.EnvironmentTests
{
[TestFixture]
public class StartupArgumentsFixture : TestBase
{
[Test]
public void empty_array_should_return_empty_flags()
{
var args = new StartupArguments(new string[0]);
args.Flags.Should().BeEmpty();
}
[TestCase("/t")]
[TestCase(" /t")]
[TestCase(" /T")]
[TestCase(" /t ")]
public void should_parse_single_flag(string arg)
{
var args = new StartupArguments(new[] { arg });
args.Flags.Should().HaveCount(1);
args.Flags.Contains("t").Should().BeTrue();
}
[TestCase("/key=value")]
[TestCase("/KEY=value")]
[TestCase(" /key=\"value\"")]
public void should_parse_args_with_alues(string arg)
{
var args = new StartupArguments(new[] { arg });
args.Args.Should().HaveCount(1);
args.Args["key"].Should().Be("value");
}
}
}