Exemplo n.º 1
0
        public static string GetDisplayedLog(this TestAppInstance app)
        {
            var viewLines     = app.ViewModel.LoadedMessagesLogViewer.ViewLines;
            var displayedText = string.Join("\n", viewLines.Select(vl => vl.TextLineValue));

            return(displayedText);
        }
Exemplo n.º 2
0
        public async Task LiveLogCanBeDeletedAndRecreated(TestAppInstance app)
        {
            var testLog = app.ModelObjects.TempFilesManager.GenerateNewName();

            using (var logWriter = new StreamWriter(testLog, append: false))
            {
                Log(logWriter, "test1");
                Log(logWriter, "test2");
                Log(logWriter, "test3");

                await app.EmulateFileDragAndDrop(testLog);

                await app.WaitForLogDisplayed("test1\ntest2\ntest3");
            }

            File.Delete(testLog);

            await app.WaitForLogDisplayed("");

            using (var logWriter = new StreamWriter(testLog, append: false))
            {
                Log(logWriter, "test4");
                Log(logWriter, "test5");
                Log(logWriter, "test6");

                await app.WaitForLogDisplayed("test4\ntest5\ntest6");
            }
        }
Exemplo n.º 3
0
        public async Task CanRemoveOneLogFromContainer(TestAppInstance app)
        {
            await ExpandContainer();

            app.ViewModel.SourcesList.OnSelectionChange(
                new[] { (IViewItem)ListRoot.Children[0].Children[0] });
            await app.WaitFor(() => ListRoot.Children[0].Children[0].IsSelected);

            Check.That(app.ViewModel.SourcesManager.DeleteSelectedSourcesButtonEnabled).IsTrue();
            Check.That(app.ViewModel.SourcesManager.PropertiesButtonEnabled).IsTrue();

            app.PresentationObjects.AlertPopup.ShowPopupAsync(null, null, UI.Presenters.AlertFlags.None).ReturnsForAnyArgs(UI.Presenters.AlertFlags.Yes);
            app.ViewModel.SourcesManager.OnDeleteSelectedLogSourcesButtonClicked();

            await app.PresentationObjects.AlertPopup.Received(1).ShowPopupAsync("Delete", "Are you sure you want to close 1 log (s)", UI.Presenters.AlertFlags.YesNoCancel);

            await app.WaitFor(() =>
                              ListRoot.Children.Count == 1 &&
                              ListRoot.Children[0].Children.Count == 0 &&
                              ListRoot.Children[0].IsSelected == false);

            Check.That(app.ViewModel.SourcesManager.DeleteSelectedSourcesButtonEnabled).IsFalse();
            Check.That(app.ViewModel.SourcesManager.PropertiesButtonEnabled).IsFalse();

            await app.WaitForLogDisplayed(
                @"No free data file found. Going sleep.
Searching for data files
No free data file found. Going sleep.
File cannot be open which means that it was handled
Timestamp parsed and ignored
Test frame
"
                );
        }
Exemplo n.º 4
0
        public async Task CanRemoveBothLogsFromContainer(TestAppInstance app)
        {
            await ExpandContainer();

            app.ViewModel.SourcesList.OnSelectionChange(new[] {
                (IViewItem)ListRoot.Children[0].Children[0],
                (IViewItem)ListRoot.Children[0].Children[1]
            });
            await app.WaitFor(() =>
                              ListRoot.Children[0].Children[0].IsSelected &&
                              ListRoot.Children[0].Children[1].IsSelected
                              );

            Check.That(app.ViewModel.SourcesManager.DeleteSelectedSourcesButtonEnabled).IsTrue();
            Check.That(app.ViewModel.SourcesManager.PropertiesButtonEnabled).IsFalse();

            app.PresentationObjects.AlertPopup.ShowPopupAsync(null, null, UI.Presenters.AlertFlags.None).ReturnsForAnyArgs(UI.Presenters.AlertFlags.Yes);
            app.ViewModel.SourcesManager.OnDeleteSelectedLogSourcesButtonClicked();

            await app.PresentationObjects.AlertPopup.Received(1).ShowPopupAsync("Delete", "Are you sure you want to close 2 log (s)", UI.Presenters.AlertFlags.YesNoCancel);

            await app.WaitFor(() => ListRoot.Children.Count == 0);

            Check.That(app.ViewModel.SourcesManager.DeleteSelectedSourcesButtonEnabled).IsFalse();
            Check.That(app.ViewModel.SourcesManager.PropertiesButtonEnabled).IsFalse();

            await app.WaitForLogDisplayed("");
        }
Exemplo n.º 5
0
        public async Task SanSaveMergedLog(TestAppInstance app)
        {
            var destinationFileName = Path.GetTempFileName();

            try
            {
                var expectedJoinedLog = File.ReadAllBytes(await app.Samples.GetSampleAsLocalFile("XmlWriterTraceListenerAndTextWriterTraceListenerJoined.log"));
                app.Mocks.FileDialogs.SaveFileDialog(Arg.Any <UI.Presenters.SaveFileDialogParams>()).ReturnsForAnyArgs(destinationFileName);
                var(visibleItems, checkedItems) = app.ViewModel.SourcesList.OnMenuItemOpening(ctrl: false);
                Check.That((visibleItems & MenuItem.SaveMergedFilteredLog) != 0).IsTrue();
                app.ViewModel.SourcesList.OnSaveMergedFilteredLogMenuItemClicked();
                var match = false;
                for (var iter = 0; iter < 25; ++iter)
                {
                    await Task.Delay(100);

                    var actualJoinedLog = File.ReadAllBytes(destinationFileName);
                    if ((match = actualJoinedLog.SequenceEqual(expectedJoinedLog)) == true)
                    {
                        break;
                    }
                }
                Check.That(match).IsTrue();
            }
            finally
            {
                if (File.Exists(destinationFileName))
                {
                    File.Delete(destinationFileName);
                }
            }
        }
Exemplo n.º 6
0
        public async Task LiveLogCanBeRewritten(TestAppInstance app)
        {
            var testLog = app.ModelObjects.TempFilesManager.GenerateNewName();

            using (var stream = new FileStream(testLog,
                                               FileMode.CreateNew, FileAccess.ReadWrite, FileShare.ReadWrite))
            {
                using (var logWriter = new StreamWriter(stream, Encoding.ASCII, 1024, leaveOpen: true))
                {
                    Log(logWriter, "test1");
                    Log(logWriter, "test2");

                    await app.EmulateFileDragAndDrop(testLog);

                    await app.WaitForLogDisplayed("test1\ntest2");
                }

                stream.SetLength(0);
                stream.Position = 0;

                using (var logWriter = new StreamWriter(stream, Encoding.ASCII, 1024, leaveOpen: true))
                {
                    Log(logWriter, "test4");

                    await app.WaitForLogDisplayed("test4");
                }
            }
        }
Exemplo n.º 7
0
        public async Task CanMaintainLiveLogProperties(TestAppInstance app)
        {
            EmulateShowTimeMenu();

            app.ViewModel.LoadedMessagesLogViewer.OnKeyPressed(UI.Presenters.LogViewer.Key.BeginOfDocument);
            await app.WaitFor(() => (DialogState.FirstMessageLinkLabel.Text ?? "").EndsWith(":37:25.985"));

            app.ViewModel.LoadedMessages.OnToggleViewTail();
            await app.WaitFor(() => DialogState.LastMessageLinkLabel.Text.EndsWith(":37:45.475"));

            var log = File.ReadAllText(tempLogFileName);

            log += "<E2ETraceEvent xmlns=\"http://schemas.microsoft.com/2004/06/E2ETraceEvent\">" +
                   "  <System xmlns=\"http://schemas.microsoft.com/2004/06/windows/eventlog/system\">" +
                   "    <EventID>0</EventID>" +
                   "    <Type>3</Type>" +
                   "    <SubType Name=\"Start\">0</SubType>" +
                   "    <Level>255</Level>" +
                   "    <TimeCreated SystemTime=\"2011-07-24T10:50:01.1000000Z\" />" +
                   "    <Source Name=\"SampleApp\" />" +
                   "    <Correlation ActivityID=\"{00000000-0000-0000-0000-000000000000}\" />" +
                   "    <Execution ProcessName=\"SampleLoggingApp\" ProcessID=\"1956\" ThreadID=\"1\" />" +
                   "    <Channel/>" +
                   "    <Computer>SERGEYS-PC</Computer>" +
                   "  </System>" +
                   "  <ApplicationData>new line</ApplicationData>" +
                   "</E2ETraceEvent>";
            File.WriteAllText(tempLogFileName, log);
            await app.WaitFor(() => DialogState.LastMessageLinkLabel.Text.EndsWith(":50:01.100"));
        }
Exemplo n.º 8
0
        public async Task CanSaveAsLogFromZipContainer(TestAppInstance app)
        {
            CloseDialog();
            app.PresentationObjects.AlertPopup.ShowPopup(null, null, UI.Presenters.AlertFlags.None).ReturnsForAnyArgs(UI.Presenters.AlertFlags.Yes);
            app.ViewModel.SourcesManager.OnDeleteAllLogSourcesButtonClicked();
            await app.EmulateFileDragAndDrop(await samples.GetSampleAsLocalFile("XmlWriterTraceListener1AndImage.zip"));

            await app.WaitFor(() => app.ViewModel.SourcesList.RootItem.Children.Count == 1);

            app.ViewModel.SourcesList.OnSelectionChange(new[] {
                (SrcListItem)app.ViewModel.SourcesList.RootItem.Children[0]
            });
            await OpenDialog();

            Check.That(DialogState.SaveAsButton.Disabled).IsFalse();
            Check.That(DialogState.SaveAsButton.Hidden).IsFalse();

            var destinationFileName = app.ModelObjects.TempFilesManager.GenerateNewName();

            app.Mocks.FileDialogs.SaveFileDialog(Arg.Any <UI.Presenters.SaveFileDialogParams>()).ReturnsForAnyArgs(destinationFileName);
            ViewModel.OnSaveAsButtonClicked();
            app.Mocks.FileDialogs.Received(1).SaveFileDialog(Arg.Any <UI.Presenters.SaveFileDialogParams>());

            var savedLog = File.ReadAllText(destinationFileName);

            var head = "<E2ETraceEvent xmlns=\"http://schemas.microsoft.com/2004/06/E2ETraceEvent\"><System xmlns=\"http://schemas.microsoft.com/2004/06/windows/eventlog/system\"><EventID>0</EventID><Type>3</Type><SubType Name=\"Start\">0</SubType><Level>255</Level><TimeCreated SystemTime=\"2011-07-24T10:37:25.9854589Z\" /><Source Name=\"SampleApp\" />";

            Check.That(head).IsEqualTo(savedLog.Substring(0, head.Length));
        }
Exemplo n.º 9
0
 public static Task EmulateUrlDragAndDrop(this TestAppInstance app, Uri uri)
 {
     return(app.ModelObjects.LogSourcesPreprocessings.Preprocess(
                new[] { app.ModelObjects.PreprocessingStepsFactory.CreateURLTypeDetectionStep(new Preprocessing.PreprocessingStepParams(uri.ToString())) },
                uri.ToString()
                ));
 }
Exemplo n.º 10
0
 public static Task EmulateFileDragAndDrop(this TestAppInstance app, string fileName)
 {
     return(app.ModelObjects.LogSourcesPreprocessings.Preprocess(
                new[] { app.ModelObjects.PreprocessingStepsFactory.CreateFormatDetectionStep(new Preprocessing.PreprocessingStepParams(fileName)) },
                fileName
                ));
 }
Exemplo n.º 11
0
 public void CanCopyLogPath(TestAppInstance app)
 {
     Check.That(DialogState.CopyPathButton.Disabled).IsFalse();
     Check.That(DialogState.CopyPathButton.Hidden).IsFalse();
     ViewModel.OnCopyButtonClicked();
     app.Mocks.ClipboardAccess.Received(1).SetClipboard(Arg.Is <string>(
                                                            s => s.ToLower().Contains("xmlwritertracelistener1.xml")));
 }
Exemplo n.º 12
0
        public void CanOpenContainingFolder(TestAppInstance app)
        {
            Check.That(DialogState.OpenContainingFolderButton.Disabled).IsFalse();
            Check.That(DialogState.OpenContainingFolderButton.Hidden).IsFalse();

            ViewModel.OnOpenContainingFolderButtonClicked();
            app.Mocks.ShellOpen.ReceivedWithAnyArgs().OpenFileBrowser(null);
        }
Exemplo n.º 13
0
        /// <summary>
        /// Adds custom format LogJoint/Test123 that is formatted as
        /// 2021/04/26 19:21:58.285 T#32 Hello world!
        /// </summary>
        public static async Task AddTestCustomFormat(this TestAppInstance app)
        {
            await System.IO.File.WriteAllTextAsync(
                System.IO.Path.Combine(app.TestFormatDirectory, "test.format.xml"),
                TestCustomFormatDefinition
                );

            app.ModelObjects.UserDefinedFormatsManager.ReloadFactories();
        }
Exemplo n.º 14
0
        public async Task CanQuitAppWhileHavingActivePreprocessingUserInteraction(TestAppInstance app)
        {
            var preprocTask = app.EmulateUrlDragAndDrop(app.Samples.GetSampleAsUri("XmlWriterTraceListenerAndTextWriterTraceListener.zip"));

            await app.WaitFor(() => app.ViewModel.PreprocessingUserInteractions.DialogData != null);

            Check.That(app.ViewModel.PreprocessingUserInteractions.DialogData.Items.Count).IsEqualTo(2);

            await app.Dispose();
        }
Exemplo n.º 15
0
        public async Task CanToggleSourceVisibitity(TestAppInstance app)
        {
            Check.That(DialogState.VisibleCheckBox.Checked).IsEqualTo(true);
            ViewModel.OnVisibleCheckBoxChange(false);
            await app.WaitFor(() => DialogState.VisibleCheckBox.Checked == false);

            await app.WaitForLogDisplayed("");

            Check.That(((SrcListItem)app.ViewModel.SourcesList.RootItem.Children[0]).Checked).IsEqualTo(false);
        }
Exemplo n.º 16
0
        public async Task WhenLogIsOpenALogHistoryEntryIsAdded(TestAppInstance app)
        {
            Check.That(app.ModelObjects.RecentlyUsedLogs.GetMRUListSize()).IsEqualTo(0);

            await app.EmulateFileDragAndDrop(await app.Samples.GetSampleAsLocalFile("XmlWriterTraceListener1.xml"));

            Check.That(app.ModelObjects.RecentlyUsedLogs.GetMRUListSize()).IsEqualTo(1);

            await app.EmulateUrlDragAndDrop(app.Samples.GetSampleAsUri("XmlWriterTraceListener1.xml"));

            Check.That(app.ModelObjects.RecentlyUsedLogs.GetMRUListSize()).IsEqualTo(2);
        }
Exemplo n.º 17
0
        public async Task CanQuitAppWhilePreprocessingIsActive(TestAppInstance app)
        {
            var downloadingPreprocessing = app.EmulateUrlDragAndDrop(app.Samples.GetSampleAsUri("chrome_debug_1.log"));

            await app.Dispose();

            Check.That(downloadingPreprocessing.IsFaulted).IsTrue();
            var webEx = downloadingPreprocessing.Exception.InnerException as System.Net.WebException;

            Check.That(webEx).IsNotNull();
            Check.That(webEx.Status).IsEqualTo(System.Net.WebExceptionStatus.RequestCanceled);
        }
Exemplo n.º 18
0
        public async Task OpeningTheSameLogTwiceHasNoEffect(TestAppInstance app)
        {
            await app.EmulateFileDragAndDrop(await app.Samples.GetSampleAsLocalFile("XmlWriterTraceListener1.xml"));

            await app.WaitFor(() => IsXmlWriterTraceListenerLogIsLoaded(app));

            Check.That(app.ModelObjects.LogSourcesManager.Items.Count()).IsEqualTo(1);

            await app.EmulateFileDragAndDrop(await app.Samples.GetSampleAsLocalFile("XmlWriterTraceListener1.xml"));

            Check.That(app.ModelObjects.LogSourcesManager.Items.Count()).IsEqualTo(1);
        }
Exemplo n.º 19
0
        public void SwitchingRawModeChangesItInSearchResults(TestAppInstance app)
        {
            app.ViewModel.LoadedMessages.OnToggleRawView();

            Check.That(app.ViewModel.LoadedMessages.ViewState.RawViewButton.Checked).IsTrue();

            Check.That(app.ViewModel.LoadedMessagesLogViewer.ViewLines[0].TextLineValue).IsEqualTo(
                "<E2ETraceEvent xmlns=\"http://schemas.microsoft.com/2004/06/E2ETraceEvent\"><System xmlns=\"http://schemas.microsoft.com/2004/06/windows/eventlog/system\"><EventID>0</EventID><Type>3</Type><SubType Name=\"Information\">0</SubType><Level>8</Level><TimeCreated SystemTime=\"2011-07-24T10:37:43.7104727Z\" /><Source Name=\"SampleApp\" /><Correlation ActivityID=\"{00000000-0000-0000-0000-000000000000}\" /><Execution ProcessName=\"SampleLoggingApp\" ProcessID=\"1956\" ThreadID=\"6\" /><Channel/><Computer>SERGEYS-PC</Computer></System><ApplicationData>File cannot be open which means that it was handled</ApplicationData></E2ETraceEvent>");

            Check.That(app.ViewModel.SearchResultLogViewer.ViewLines[3].TextLineValue).IsEqualTo(
                "<E2ETraceEvent xmlns=\"http://schemas.microsoft.com/2004/06/E2ETraceEvent\"><System xmlns=\"http://schemas.microsoft.com/2004/06/windows/eventlog/system\"><EventID>0</EventID><Type>3</Type><SubType Name=\"Start\">0</SubType><Level>255</Level><TimeCreated SystemTime=\"2011-07-24T10:37:41.7633614Z\" /><Source Name=\"SampleApp\" /><Correlation ActivityID=\"{00000000-0000-0000-0000-000000000000}\" /><Execution ProcessName=\"SampleLoggingApp\" ProcessID=\"1956\" ThreadID=\"6\" /><Channel/><Computer>SERGEYS-PC</Computer></System><ApplicationData>Processing new file: d5021b3c-f9ae-4860-a429-d0f32e2b7403.data</ApplicationData></E2ETraceEvent>");
        }
Exemplo n.º 20
0
        public void ByDefaultTextModeIsSummaryForXmlWriterTraceFormat(TestAppInstance app)
        {
            var vs = app.ViewModel.LoadedMessages.ViewState;

            Check.That(vs.RawViewButton.Visible).IsTrue();
            Check.That(vs.RawViewButton.Checked).IsFalse();

            Check.That(app.ViewModel.LoadedMessagesLogViewer.ViewLines[0].TextLineValue).IsEqualTo(
                "File cannot be open which means that it was handled");

            Check.That(app.ViewModel.SearchResultLogViewer.ViewLines[3].TextLineValue).IsEqualTo(
                "Processing new file: d5021b3c-f9ae-4860-a429-d0f32e2b7403.data");
        }
Exemplo n.º 21
0
        public void SwitchingColoringChangesItInSearchResults(TestAppInstance app)
        {
            app.ViewModel.LoadedMessages.OnColoringButtonClicked(0);

            Check.That(app.ViewModel.LoadedMessages.ViewState.Coloring.Selected).IsEqualTo(0);

            var vl1 = app.ViewModel.LoadedMessagesLogViewer.ViewLines;

            Check.That(vl1[0].ContextColor).IsEqualTo(vl1[2].ContextColor);

            var vl2 = app.ViewModel.SearchResultLogViewer.ViewLines;

            Check.That(vl2[19].ContextColor).IsEqualTo(vl2[13].ContextColor);
        }
Exemplo n.º 22
0
        public async Task BeforeEach(TestAppInstance app)
        {
            this.appInstance = app;

            var preprocTask = app.EmulateFileDragAndDrop(await app.Samples.GetSampleAsLocalFile("XmlWriterTraceListenerAndTextWriterTraceListener.zip"));

            await app.WaitFor(() => app.ViewModel.PreprocessingUserInteractions.DialogData != null);

            app.ViewModel.PreprocessingUserInteractions.OnCloseDialog(accept: true);

            await preprocTask;

            await app.WaitFor(() => app.ViewModel.SourcesList.RootItem.Children.Count == 1);
        }
Exemplo n.º 23
0
        public static IDisposable AutoAcceptPreprocessingUserInteration(this TestAppInstance app)
        {
            UI.Presenters.PreprocessingUserInteractions.DialogViewData acceptedData = null;
            var subs = app.ModelObjects.ChangeNotification.CreateSubscription(() =>
            {
                var currentData = app.ViewModel.PreprocessingUserInteractions.DialogData;
                if (currentData != null && currentData != acceptedData)
                {
                    acceptedData = currentData;
                    app.ViewModel.PreprocessingUserInteractions.OnCloseDialog(accept: true);
                }
            });

            return(subs);
        }
Exemplo n.º 24
0
        public void SourceListIsPopulated(TestAppInstance app)
        {
            Check.That(ListRoot.Children.Count).IsEqualTo(1);
            var container = (IViewItem)ListRoot.Children[0];

            Check.That(container.Children.Count).IsEqualTo(2);
            Check.That(container.IsExpanded).IsFalse();
            Check.That(container.Checked).IsEqualTo(true);
            Check.That(container.ToString()).Contains("XmlWriterTraceListenerAndTextWriterTraceListener.zip");
            Check.That(container.ToString()).EndsWith("(2 logs)");
            Check.That(container.Children[0].ToString().ToLower().Contains(@"xmlwritertracelistenerandtextwritertracelistener.zip\xmlwritertracelistener1.xml")).IsTrue();
            Check.That(((IViewItem)container.Children[0]).Checked).IsEqualTo(true);
            Check.That(container.Children[1].ToString().ToLower().Contains(@"xmlwritertracelistenerandtextwritertracelistener.zip\textwritertracelistener.log")).IsTrue();
            Check.That(((IViewItem)container.Children[1]).Checked).IsEqualTo(true);
        }
Exemplo n.º 25
0
 public static async Task WaitForLogDisplayed(this TestAppInstance app, string expectedLog, string operationName = null, TimeSpan?timeout = null)
 {
     try
     {
         await app.WaitFor(
             () => app.IsLogDisplayed(expectedLog),
             operationName : operationName,
             timeout : timeout
             );
     }
     catch (TimeoutException)
     {
         Console.WriteLine("Actually displayed log: '{0}'", app.GetDisplayedLog());
         throw;
     }
 }
Exemplo n.º 26
0
        public async Task CanDownloadZipExtractFindManyKnownLogsAndAskUserWhatToOpen(TestAppInstance app)
        {
            var preprocTask = app.EmulateUrlDragAndDrop(app.Samples.GetSampleAsUri("XmlWriterTraceListenerAndTextWriterTraceListener.zip"));

            await app.WaitFor(() => app.ViewModel.PreprocessingUserInteractions.DialogData != null);

            var userQueryItems = app.ViewModel.PreprocessingUserInteractions.DialogData.Items;

            Check.That(userQueryItems.Count).IsEqualTo(2);
            Check.That(userQueryItems.Any(x => x.Title.Contains("Microsoft\\XmlWriterTraceListener") && x.Title.Contains("XmlWriterTraceListenerAndTextWriterTraceListener.zip\\XmlWriterTraceListener1.xml"))).IsTrue();
            Check.That(userQueryItems.Any(x => x.Title.Contains("Microsoft\\TextWriterTraceListener") && x.Title.Contains("XmlWriterTraceListenerAndTextWriterTraceListener.zip\\TextWriterTraceListener.log"))).IsTrue();
            Check.That(preprocTask.IsCompleted).IsFalse();

            app.ViewModel.PreprocessingUserInteractions.OnCloseDialog(accept: true);
            await preprocTask;
        }
Exemplo n.º 27
0
        public void ByDefaultColoringIsThreads(TestAppInstance app)
        {
            var vs = app.ViewModel.LoadedMessages.ViewState;

            Check.That(vs.Coloring.Visible).IsTrue();
            Check.That(vs.Coloring.Selected).IsEqualTo(1);
            Check.That(vs.Coloring.Options[1].Text.ToLower().Contains("thread"));

            var vl1 = app.ViewModel.LoadedMessagesLogViewer.ViewLines;

            Check.That(vl1[0].ContextColor).IsNotEqualTo(vl1[2].ContextColor);

            var vl2 = app.ViewModel.SearchResultLogViewer.ViewLines;

            Check.That(vl2[19].ContextColor).IsNotEqualTo(vl2[13].ContextColor);
        }
Exemplo n.º 28
0
        public async Task BeforeEach()
        {
            app = await TestAppInstance.Create();

            await app.SynchronizationContext.InvokeAndAwait(async() =>
            {
                tempLogFileName = Path.Combine(app.AppDataDirectory, "XmlWriterTraceListener1.xml");
                File.Copy(await samples.GetSampleAsLocalFile("XmlWriterTraceListener1.xml"), tempLogFileName, overwrite: true);
                await app.EmulateFileDragAndDrop(tempLogFileName);
                await app.WaitFor(() => app.ViewModel.SourcesList.RootItem.Children.Count == 1);
                app.ViewModel.SourcesList.OnSelectionChange(new[] {
                    (SrcListItem)app.ViewModel.SourcesList.RootItem.Children[0]
                });
                await OpenDialog();
            });
        }
Exemplo n.º 29
0
        public async Task BeforeEach()
        {
            app = await TestAppInstance.Create();

            await app.SynchronizationContext.InvokeAndAwait(async() =>
            {
                var preprocTask = app.EmulateFileDragAndDrop(await samples.GetSampleAsLocalFile("XmlWriterTraceListenerAndTextWriterTraceListener.zip"));

                await app.WaitFor(() => app.ViewModel.PreprocessingUserInteractions.DialogData != null);
                app.ViewModel.PreprocessingUserInteractions.OnCloseDialog(accept: true);

                await preprocTask;

                await app.WaitFor(() => app.ViewModel.SourcesList.RootItem.Children.Count == 1);
            });
        }
Exemplo n.º 30
0
        public async Task UnzippingCanBeCancelled(TestAppInstance app)
        {
            var preprocessorTask = app.EmulateFileDragAndDrop(await app.Samples.GetSampleAsLocalFile("network_trace_with_keys_1.as_pdml.zip"));
            await app.WaitFor(() => (app.ViewModel.SourcesList.RootItem.Children.ElementAtOrDefault(0)?.ToString() ?? "").Contains("Unpacking"));

            app.ViewModel.SourcesList.OnSelectAllShortcutPressed();
            app.Mocks.AlertPopup.ShowPopup(null, null, UI.Presenters.AlertFlags.None).ReturnsForAnyArgs(
                UI.Presenters.AlertFlags.Yes);
            var stopwatch = Stopwatch.StartNew();

            app.ViewModel.SourcesList.OnDeleteButtonPressed();
            await app.WaitFor(() => app.ViewModel.SourcesList.RootItem.Children.Count == 0);

            stopwatch.Stop();
            Check.That(stopwatch.ElapsedMilliseconds).IsStrictlyLessThan(1000);
            Check.That(preprocessorTask.IsCanceled).IsTrue();
        }