public void Handle_InDB_UserRequest_True_Test() { var message = $"تست لاگ برداری در متد Handle_InDB_UserRequest_True_Test در تاریخ {DateTime.Now.ToShortDateString()}"; var service = ConstructService(); var requestInfo = ServiceBase.DependencyInjectionFactory.CreateInjectionInstance <IRequest>(); var userRequest = new MockUserRequest(); requestInfo.UserRequest = userRequest; // act service.Handle(new NotFiniteNumberException("NotFiniteNumber", new PlatformNotSupportedException()), message); //assert var registeredLog = service.Filter(log => log.Request.IP.Equals("::1")); Assert.IsTrue(registeredLog.Any()); }
public void Write_InDB_UserRequest_True_Test() { var message = $"تست لاگ برداری در متد Write_InDB_UserRequest_True_Test در تاریخ {DateTime.Now.ToShortDateString()}"; var service = ConstructService(); var requestInfo = ServiceBase.DependencyInjectionFactory.CreateInjectionInstance <IRequest>(); var userRequest = new MockUserRequest(); requestInfo.UserRequest = userRequest; // act service.Write(message); //assert var registeredLog = service.Filter(log => log.Request.IP.Equals("::1")); Assert.IsTrue(registeredLog.Any()); }