public void Parse_OnValidInput_ReturnsSuccess() { IEventLineParser parser = new EventLineParser(); (bool success, var _) = parser.Parse( @"2018-07-18 14:38:08.591 +01:00 [Information] DasBlog.Web.Controllers.AccountController: SecuritySuccess :: [email protected] logged in successfully :: http://localhost:50432/Account/Login" ); Assert.True(success); }
public void Parse_OnInvalidInput_ReturnsFailure() { IEventLineParser parser = new EventLineParser(); (bool success, var _) = parser.Parse( @"2018-07-18 09:10:08.388 +01:00 [Information] Microsoft.AspNetCore.Authorization.DefaultAuthorizationService: Authorization failed for user: (null)." ); Assert.False(success); }
public void GetEventsForDay_OnEventPlusStackTracePlusNonEvent_ReturnsOneEvent() { IActivityRepoFactory factory = new MockActivityRepoFactory(); IEventLineParser parser = new EventLineParser(); ActivityService service = new ActivityService(factory, parser, new Microsoft.Extensions.Logging.Abstractions.NullLogger <ActivityService>()); int ctr = 0; foreach (var eddi in service.GetEventsForDay(new DateTime(2000, 1, 1))) { ctr++; } Assert.Equal(1, ctr); }