Пример #1
0
        public void Launch_ShouldStart_ElevatedProcess()
        {
            var launchable = new LaunchableFile(_processes);

            launchable.Launch("", "");

            _processes.ElevatedProcess("", "").Received(1).Start();
        }
Пример #2
0
        public void Valid_ShouldPassException_WhenElevatedProcess_Start_Throws()
        {
            _processes.ElevatedProcess("", "").WhenForAnyArgs(x => x.Start()).Throws <Exception>();
            var launchable = new LaunchableFile(_processes);

            Action action = () => launchable.Launch("", "");

            action.Should().Throw <Exception>();
        }
Пример #3
0
        public void Launch_ShouldCreate_ElevatedProcess()
        {
            const string filename   = "File to launch";
            const string args       = "Launch arguments";
            var          launchable = new LaunchableFile(_processes);

            launchable.Launch(filename, args);

            _processes.Received(1).ElevatedProcess(filename, args);
        }