using Church.Net.DAL.EF; using Church.Net.DAL.EFCoreDBF.Interface; using Church.Net.Entity; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using System; using WebAPI.Logics; using WebAPI.Logics.Core; using WebAPI.Logics.Interface; using WebAPI.Services; using WebAPI.Services.AutoReplyCommands; using WebAPI.Services.Interfaces; namespace TestProject { public class DateTimeTest : TestBase { private ICrudLogic? logic; private LineAutoBotService? botLogic; private ICrudDAL? groupEventDALC; [SetUp] public void Setup() { base.Setup(); logic = serviceProvider.GetService>(); botLogic = serviceProvider.GetService(); groupEventDALC = serviceProvider.GetService>(); } [Test] public void GetComingEvent() { var _event = groupEventDALC.GetDbSet().Where(e => e.Time > DateTime.Today).FirstOrDefault(); Assert.IsNotNull(_event); var utcToday = DateTime.Today.ToUniversalTime(); _event = groupEventDALC.GetDbSet().Where(e => e.Time >= DateTime.UtcNow).FirstOrDefault(); Assert.IsNull(_event); } } }