public void ReportSettings() { var svc = new TelemetryTestService(); string log; using (var t = new RtvsTelemetry(_packageIndex, svc)) { t.ReportSettings(); log = svc.SessionLog; } log.Length.Should().BeGreaterThan(0); log.Should().Contain("Cran"); log.Should().Contain("LoadRData"); log.Should().Contain("SaveRData"); log.Should().Contain("RCommandLineArguments"); log.Should().Contain("MultilineHistorySelection"); log.Should().Contain("AlwaysSaveHistory"); log.Should().Contain("AutoFormat"); log.Should().Contain("CommitOnEnter"); log.Should().Contain("CommitOnSpace"); log.Should().Contain("FormatOnPaste"); log.Should().Contain("SendToReplOnCtrlEnter"); log.Should().Contain("ShowCompletionOnFirstChar"); log.Should().Contain("SignatureHelpEnabled"); log.Should().Contain("CompletionEnabled"); log.Should().Contain("SyntaxCheckInRepl"); log.Should().Contain("PartialArgumentNameMatch"); }
public void ReportWindowLayout() { var svc = new TelemetryTestService(); var shell = new VsUiShellMock(); Guid g = new Guid("6B72640E-99F8-40A5-BCDB-BB8CF250A1B5"); Guid p1 = new Guid("E5815AEF-4D98-4BC4-84A0-5DF62ED0755D"); Guid p2 = new Guid("22130C87-7D87-4C41-9BC0-14BFA3261DA8"); Guid p3 = new Guid("B7AF6C09-BC6F-41F1-AF1A-B67D267F1C0E"); IVsWindowFrame frame; shell.CreateToolWindow(0, 1, null, ref g, ref p1, ref g, null, "Window#1", null, out frame); shell.CreateToolWindow(0, 2, null, ref g, ref p2, ref g, null, "Window#2", null, out frame); shell.CreateToolWindow(0, 3, null, ref g, ref p3, ref g, null, "Window#3", null, out frame); string log; using (var t = new RtvsTelemetry(_packageIndex, svc)) { t.ReportWindowLayout(shell); log = svc.SessionLog; } log.Length.Should().BeGreaterThan(0); log.Should().Contain("Window#1"); log.Should().Contain("Window#2"); log.Should().Contain("Window#3"); log.Should().Contain("100"); }
public void TelemetryTestService_DefaultPrefixConstructorTest() { TelemetryTestService telemetryService = new TelemetryTestService(); Assert.AreEqual(TelemetryTestService.EventNamePrefixString, telemetryService.EventNamePrefix); Assert.AreEqual(TelemetryTestService.PropertyNamePrefixString, telemetryService.PropertyNamePrefix); }
public void TelemetryTestService_CustomPrefixConstructorTest() { var eventPrefix = "Event/Prefix/"; var propertyPrefix = "Property.Prefix."; TelemetryTestService telemetryService = new TelemetryTestService(eventPrefix, propertyPrefix); Assert.AreEqual(eventPrefix, telemetryService.EventNamePrefix); Assert.AreEqual(propertyPrefix, telemetryService.PropertyNamePrefix); }
public void TelemetryTestService_SimpleEventTest() { var area = "Options"; var eventName = "event"; TelemetryTestService telemetryService = new TelemetryTestService(); telemetryService.ReportEvent(area, eventName); string log = telemetryService.SessionLog; Assert.AreEqual(TelemetryTestService.EventNamePrefixString + area.ToString() + "/" + eventName + "\r\n", log); }
public void TelemetryTestService_EventWithParametersTest() { var area = "Options"; var eventName = "event"; TelemetryTestService telemetryService = new TelemetryTestService(); telemetryService.ReportEvent(area, eventName, new { parameter = "value" }); string log = telemetryService.SessionLog; Assert.AreEqual(TelemetryTestService.EventNamePrefixString + area.ToString() + "/" + eventName + "\r\n\t" + TelemetryTestService.PropertyNamePrefixString + area.ToString() + ".parameter : value\r\n", log); }
public void ReportConfiguration() { var svc = new TelemetryTestService(); string log; using (var t = new RtvsTelemetry(_packageIndex, svc)) { t.ReportConfiguration(); log = svc.SessionLog; } log.Length.Should().BeGreaterThan(0); log.Should().Contain(TelemetryTestService.EventNamePrefixString); log.Should().Contain(RtvsTelemetry.ConfigurationEvents.RPackages); }
public void ReportSettings() { var svc = new TelemetryTestService(); string log; using (var t = new RtvsTelemetry(_packageIndex, new RSettingsStub(), _editorSettings, _markdownSettings, svc)) { t.ReportSettings(); log = svc.SessionLog; } log.Length.Should().BeGreaterThan(0); log.Should().Contain("Cran"); log.Should().Contain("LoadRData"); log.Should().Contain("SaveRData"); log.Should().Contain("RCommandLineArguments"); log.Should().Contain("MultilineHistorySelection"); log.Should().Contain("AlwaysSaveHistory"); log.Should().Contain("AutoFormat"); log.Should().Contain("CommitOnEnter"); log.Should().Contain("CommitOnSpace"); log.Should().Contain("FormatOnPaste"); log.Should().Contain("ShowCompletionOnFirstChar"); log.Should().Contain("SignatureHelpEnabled"); log.Should().Contain("CompletionEnabled"); log.Should().Contain("SyntaxCheckInRepl"); log.Should().Contain("LinterEnabled"); log.Should().Contain("LinterCamelCase"); log.Should().Contain("LinterPascalCase"); log.Should().Contain("LinterSnakeCase"); log.Should().Contain("LinterUpperCase"); log.Should().Contain("LinterSemicolons"); log.Should().Contain("LinterMultipleDots"); log.Should().Contain("LinterMultipleStatements"); log.Should().Contain("LinterNameLength"); log.Should().Contain("LinterMaxNameLength"); log.Should().Contain("LinterAssignmentType"); log.Should().Contain("LinterSpaceAroundComma"); log.Should().Contain("LinterSpaceBeforeOpenBrace"); log.Should().Contain("LinterSpacesAroundOperators"); log.Should().Contain("LinterSpacesInsideParenthesis"); log.Should().Contain("LinterCloseCurlySeparateLine"); log.Should().Contain("LinterNoSpaceAfterFunctionName"); log.Should().Contain("LinterOpenCurlyPosition"); log.Should().Contain("LinterNoTabs"); log.Should().Contain("LinterTrailingWhitespace"); log.Should().Contain("LinterTrailingBlankLines"); log.Should().Contain("LinterDoubleQuotes"); log.Should().Contain("LinterLineLength"); log.Should().Contain("LinterMaxLineLength"); }
public static ICoreServices CreateReal() { var appConstants = new TestAppConstants(); var telemetryService = new TelemetryTestService(); var registry = new RegistryImpl(); var loggingPermissions = new LoggingPermissions(appConstants, telemetryService, registry); var log = new Logger(new NullLogWriter(), loggingPermissions); var fileSystem = new FileSystem(); var processServices = new ProcessServices(); return(new CoreServices( telemetryService, loggingPermissions, new SecurityServiceStub(), new TestTaskService(), UIThreadHelper.Instance, log, fileSystem, processServices)); }