public void Check02LoggerBOk() { //SETUP //ATTEMPT _loggerB.Info("a message"); //VERIFY Trace.Flush(); var logs = _loggedData.ToString().Split('\n').Where(x => x != string.Empty).Select(x => x.Trim()).ToArray(); logs.Length.ShouldEqual(1); logs[0].ShouldEndWith("B: a message"); }
public void ReconfigurationLogLevelWillNotWriteTest() { //Given var numberOfExistingMessages = GetTestingOutputFileLines.Length; LogAndCheckInfoMessage(); _logger.SetLogLevelToFatal(); //When _logger.Info("I will never be displayed in the file"); //Then _logger.SetLogLevelToDebug(); LogAndCheckInfoMessage(); Assert.AreEqual(numberOfExistingMessages + 2, GetTestingOutputFileLines.Length, "Messages that should have been logged have not been logged"); }
public SingleResult <TEntity> Get([FromODataUri] TFirstKey firstKey, [FromODataUri] TSecondKey secondKey) { _logger.Info($"Autocar.API.Framework {_principal.Identity.Name} Retrieving single item of {typeof(TEntity).Name}, by firstKey {firstKey}{secondKey}"); var expression = _primaryKeyPredicate(firstKey, secondKey); return(SingleResult.Create(_context.Set <TEntity>().Where(expression))); }
public virtual IQueryable <TEntity> Get() { _logger.Info($"Autocar.API.Framework {_principal.Identity.Name} Reading data on {typeof(TEntity).Name}"); return(_context.Set <TEntity>()); }