public void returns_expected_command_shell_when_shell_is_not_defined(OperatingSystemType operatingSystemType, string expected) { var sut = new RealCommandFactory(new StubOperatingSystemTypeProvider(operatingSystemType)); var result = sut.Create("?"); Assert.Equal(expected, result.Shell); }
public void returns_expected_command(string expectedShell, string expectedPreparedArgument, string inputAction, OperatingSystemType operatingSystemType) { var stubOperatingSystemTypeProvider = new StubOperatingSystemTypeProvider(operatingSystemType); var sut = new RealCommandFactory(stubOperatingSystemTypeProvider); var result = sut.Create(expectedShell); Assert.Equal(expectedShell, result.Shell); Assert.Equal(expectedPreparedArgument, result.PrepareArguments(inputAction)); }
public void returns_expected_custom_command(string shellDefinition, string inputAction, string expectedShell, string expectedPreparedArgument, OperatingSystemType operatingSystemType) { // !/full/path/or/alias,<args> // !/full/path/or/alias,[1=2]<args> var stubOperatingSystemTypeProvider = new StubOperatingSystemTypeProvider(operatingSystemType); var sut = new RealCommandFactory(stubOperatingSystemTypeProvider); var result = sut.Create(shellDefinition); Assert.Equal(expectedShell, result.Shell); Assert.Equal(expectedPreparedArgument, result.PrepareArguments(inputAction)); }