gpt4 book ai didi

org.dmfs.rfc5545.hamcrest.datetime.YearMatcher.inYear()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 16:37:31 25 4
gpt4 key购买 nike

本文整理了Java中org.dmfs.rfc5545.hamcrest.datetime.YearMatcher.inYear()方法的一些代码示例,展示了YearMatcher.inYear()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YearMatcher.inYear()方法的具体详情如下:
包路径:org.dmfs.rfc5545.hamcrest.datetime.YearMatcher
类名称:YearMatcher
方法名:inYear

YearMatcher.inYear介绍

暂无

代码示例

代码示例来源:origin: dmfs/lib-recur

@Test
  public void test() throws InvalidRecurrenceRuleException
  {
    assertThat(new RecurrenceRule("FREQ=WEEKLY;COUNT=1000"),
        is(validRule(DateTime.parse("20180101"),
            walking(),
            instances(are(onWeekDay(MO))),
            results(1000))));

    assertThat(new RecurrenceRule("FREQ=MONTHLY;INTERVAL=1;BYDAY=+3TH;UNTIL=20140101T045959Z;WKST=SU"),
        is(validRule(DateTime.parse("20130101T050000Z"),
            walking(),
            instances(are(onWeekDay(TH), onDayOfMonth(15, 16, 17, 18, 19, 20, 21), inYear(2013), before("20140101T050000Z"))),
            startingWith("20130117T050000Z", "20130221T050000Z", "20130321T050000Z"),
            results(12))));
  }
}

代码示例来源:origin: dmfs/lib-recur

@Test
  public void test() throws Exception
  {
    assertThat(inYear(2018),
        AllOf.<Matcher<DateTime>>allOf(
            matches(DateTime.parse("20181001T010001Z")),
            mismatches(DateTime.parse("20210901T005959Z"), "year was <2021>"),
            mismatches(DateTime.parse("20171101T010000Z"), "year was <2017>"),
            describesAs("year (<2018>)")
        ));
    assertThat(inYear(2018, 2019, 2020),
        AllOf.<Matcher<DateTime>>allOf(
            matches(DateTime.parse("20181001T010001Z")),
            matches(DateTime.parse("20190801T010002Z")),
            matches(DateTime.parse("20200601T010003Z")),
            mismatches(DateTime.parse("20110501T005959Z"), "year was <2011>"),
            mismatches(DateTime.parse("20170701T005958Z"), "year was <2017>"),
            mismatches(DateTime.parse("20210901T005957Z"), "year was <2021>"),
            mismatches(DateTime.parse("20301101T010000Z"), "year was <2030>"),
            describesAs("year (<2018> or <2019> or <2020>)")
        ));

  }
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com