Пример #1
0
        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);
        }
Пример #2
0
        public void returns_expected_default_shell(OperatingSystemType operatingSystemType, string expected)
        {
            var sut    = new RealCommandFactory(new StubOperatingSystemTypeProvider(operatingSystemType));
            var result = sut.GetDefaultOSShell();

            Assert.Equal(expected, result);
        }
Пример #3
0
        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));
        }
Пример #4
0
        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));
        }