public void TestSelectTimeByMovieIdDatetimeTrue() { DateTime timeStart = new DateTime(2018, 7, 20, 0, 0, 0); string comparedatetime1 = timeStart.ToString($"{timeStart:yyyy-MM-dd}"); Assert.NotNull(sch.SelectTime(1, comparedatetime1)); }
public List <Schedules> SelectTime(int movie_id, string date) { string regexDate = @"(?<year>\d{2,4})-(?<month>\d{1,2})-(?<day>\d{1,2})"; if (Regex.IsMatch(date, regexDate) != true) { return(null); } return(sche.SelectTime(movie_id, date)); }
public List <Schedules> SelectTime(int movie_id, string date) { Regex regexDate = new Regex(@"(?<year>\d{2,4})-(?<month>\d{1,2})-(?<day>\d{1,2})"); MatchCollection matchCollectionDate = regexDate.Matches(date); if (matchCollectionDate.Count <= 0) { return(null); } return(sche.SelectTime(movie_id, date)); }