public void TimerTrigger_WithValidLoggerProvided_LogsMessageSuccessfully()
        {
            var logger = (ListLogger)TestFactory.CreateLogger(LoggerTypes.List);

            TimerTrigger.Run(null, logger);
            var msg = logger.Logs[0];

            Assert.Contains("C# Timer trigger function executed at", msg);
        }
Exemple #2
0
        public void TimerShouldLogMessage()
        {
            //Arrange
            var logger = new ListLogger();

            //Act
            TimerTrigger.Run(null, logger);

            //Assert

            Assert.Single(logger.Logs, $"C# Timer trigger function executed at: {_now}");
        }
Exemple #3
0
        public void TimerShouldLogMessage2()
        {
            //Arrange
            var logger = Substitute.For <ILogger>();

            //Act
            TimerTrigger.Run(null, logger);

            //Assert
            logger
            .Received()
            .Log(LogLevel.Information,
                 0,
                 Arg.Is <FormattedLogValues>(states => states[0].Value.Equals($"C# Timer trigger function executed at: {_now}")),
                 null,
                 Arg.Any <Func <FormattedLogValues, Exception, string> >());
        }