Пример #1
0
        private async Task ConnectAndMakeTashRegistrationAsync()
        {
            var tashErrorsAndInfos = await TashAccessor.EnsureTashAppIsRunningAsync();

            if (tashErrorsAndInfos.AnyErrors())
            {
                MessageBox.Show(string.Join("\r\n", tashErrorsAndInfos.Errors), Properties.Resources.CouldNotConnectToTash, MessageBoxButton.OK, MessageBoxImage.Error);
                Close();
            }

            var statusCode = await TashAccessor.PutControllableProcessAsync(Process.GetCurrentProcess());

            if (statusCode != HttpStatusCode.Created)
            {
                MessageBox.Show(string.Format(Properties.Resources.CouldNotMakeTashRegistration, statusCode.ToString()), Properties.Resources.TashHostWindowTitle, MessageBoxButton.OK, MessageBoxImage.Error);
                Close();
            }
        }
Пример #2
0
    private async Task LaunchTashAppIfNotRunning()
    {
        var errorsAndInfos = await _Sut.EnsureTashAppIsRunningAsync();

        Assert.IsFalse(errorsAndInfos.AnyErrors(), string.Join("\r\n", errorsAndInfos.Errors));
    }