Ejemplo n.º 1
0
        public void Launch_ShouldPassException_WhenOriginThrows()
        {
            _origin.WhenForAnyArgs(x => x.Launch("", "")).Throw <SomeException>();
            var launchable = new SafeLaunchableFile(_origin);

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

            action.Should().Throw <SomeException>();
        }
Ejemplo n.º 2
0
        private void Launch_ShouldThrow_AppUpdateException_WhenOriginThrows(Exception ex)
        {
            TestInitialize();
            _origin.WhenForAnyArgs(x => x.Launch("", "")).Throw(ex);
            var launchable = new SafeLaunchableFile(_origin);

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

            action.Should().Throw <AppUpdateException>();
        }
Ejemplo n.º 3
0
        public void Launch_ShouldCall_Origin_Launch_WithArguments()
        {
            const string filename   = "File to launch";
            const string args       = "Launch arguments";
            var          launchable = new SafeLaunchableFile(_origin);

            launchable.Launch(filename, args);

            _origin.Received(1).Launch(filename, args);
        }