public void GetLogLevel_ReturnsLoggerLogLevel(LogLevel expectedLogLevel) { var logger = new RestoreCollectorLogger(Mock.Of <ILogger>(), expectedLogLevel); var actualLogLevel = LogRequestHandler.GetLogLevel(logger); Assert.Equal(expectedLogLevel, actualLogLevel); }
public void DelegateResolverConstructorTest() { LogRequestHandler requestHandler = null; // TODO: Initialize to an appropriate value DelegateResolver target = new DelegateResolver(requestHandler); Assert.Inconclusive("TODO: Implement code to verify target"); }
public void GetLogLevel_ThrowsForNullLogger() { var exception = Assert.Throws <ArgumentNullException>( () => LogRequestHandler.GetLogLevel(logger: null)); Assert.Equal("logger", exception.ParamName); }
private async Task SetLogLevelAsync(ILogger logger, CancellationToken cancellationToken) { var logLevel = LogRequestHandler.GetLogLevel(logger); await _plugin.Connection.SendRequestAndReceiveResponseAsync <SetLogLevelRequest, SetLogLevelResponse>( MessageMethod.SetLogLevel, new SetLogLevelRequest(logLevel), cancellationToken); }
internal LogRequestHandlerTest(LogLevel logLevel = LogLevel.Debug) { Logger = new Mock <ILogger>(MockBehavior.Strict); Handler = new LogRequestHandler(new RestoreCollectorLogger(Logger.Object, logLevel)); Request = MessageUtilities.Create( requestId: "a", type: MessageType.Request, method: MessageMethod.Log, payload: new LogRequest(LogLevel.Debug, "b")); }
public void RequestHandlerTest() { DelegateResolver target = new DelegateResolver(); // TODO: Initialize to an appropriate value LogRequestHandler expected = null; // TODO: Initialize to an appropriate value LogRequestHandler actual; target.RequestHandler = expected; actual = target.RequestHandler; Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
private async Task SetPluginLogLevelAsync(PluginCreationResult plugin, ILogger logger, CancellationToken cancellationToken) { var logLevel = LogRequestHandler.GetLogLevel(logger); await plugin.PluginMulticlientUtilities.DoOncePerPluginLifetimeAsync( MessageMethod.SetLogLevel.ToString(), () => plugin.Plugin.Connection.SendRequestAndReceiveResponseAsync <SetLogLevelRequest, SetLogLevelResponse>( MessageMethod.SetLogLevel, new SetLogLevelRequest(logLevel), cancellationToken), cancellationToken); }
public void Log_script_inject_test() { TestHelper.UIRun((browser) => { LogRequestHandler handler = new LogRequestHandler(); browser.GoTo("http://localhost/test/logtest.htm"); browser.WaitForComplete(); handler.HandleRequest(new UrlRequest() { HttpContext = TestHelper.Context }); }); }
// Constructor public MainPage() { InitializeComponent(); initTiSettings(); Logger.init(settings); requestHandlers["download"] = new DownloadRequestHandler(); requestHandlers["file"] = new FileRequestHandler(); requestHandlers["log"] = new LogRequestHandler(); requestHandlers["reflection"] = new ReflectionRequestHandler(app, browser, root); xhrProxy = new XHRProxy(9999); }
private async void browser_Loaded(object sender, RoutedEventArgs e) { await Logger.init(settings); requestHandlers["download"] = new DownloadRequestHandler(); requestHandlers["file"] = new FileRequestHandler(); requestHandlers["log"] = new LogRequestHandler(); requestHandlers["reflection"] = new ReflectionRequestHandler(app, browser, root); // generate the security token this.securityToken = Guid.NewGuid().ToString(); this.xhrProxy.securityToken = this.securityToken; Logger.log("WebBrowser", "Browser loaded, opening index.html"); browser.Navigate(new Uri("index.html#" + this.securityToken, UriKind.Relative)); }
public void GetLogLevel_ReturnsInformationIfNotLoggerBase() { var logLevel = LogRequestHandler.GetLogLevel(Mock.Of <ILogger>()); Assert.Equal(LogLevel.Information, logLevel); }
/// <summary> Initializes the underlying factory with delegates that receive requests for both the default and named logs. </summary> /// <param name="requestHandler"> A delegate which is called if the underlying factory's <see cref="ILogFactory.GetLog(string)" /> method is being invoked.<br /> /// Submitting a null reference causes the underlying factory to return a <see cref="NullLog" /> instance if <see cref="ILogFactory.GetLog(string)" /> is being invoked. </param> public DelegateResolver(LogRequestHandler requestHandler) { //null references are being accepted factory = new DelegateFactory(requestHandler); }
public CommonResponse ProcessRequest(LogRequest[] pRequests) { LogRequestHandler handler = new LogRequestHandler(); return(handler.Process(pRequests)); }
/// <summary> Initializes the factory with a delegate that receives requests for named logger instances. </summary> /// <param name="requestHandler"> A delegate which is called if the factory's <see cref="GetLog(string)" /> method is being invoked.<br /> /// Submitting a null reference causes the factory to return a <see cref="NullLog" /> instance if <see cref="GetLog(string)" /> is being invoked. </param> public DelegateFactory(LogRequestHandler requestHandler) { //null references are being accepted RequestHandler = requestHandler; }