Package com.opengamma.master.holiday

Examples of com.opengamma.master.holiday.HolidayMaster


   
    assertEquals(true, testResult);
  }

  public void test_isHoliday_LocalDateCurrency_workday() throws Exception {
    HolidayMaster mock = mock(HolidayMaster.class);
    HolidaySearchRequest request = new HolidaySearchRequest(GBP);
    request.setDateToCheck(DATE_MONDAY);
    request.setVersionCorrection(VC);
    HolidaySearchResult result = new HolidaySearchResult();
   
    when(mock.search(request)).thenReturn(result);
    MasterHolidaySource test = new MasterHolidaySource(mock, VC);
    boolean testResult = test.isHoliday(DATE_MONDAY, GBP);
    verify(mock, times(1)).search(request);
   
    assertEquals(false, testResult);
View Full Code Here


   
    assertEquals(false, testResult);
  }

  public void test_isHoliday_LocalDateCurrency_sunday() throws Exception {
    HolidayMaster mock = mock(HolidayMaster.class);
    HolidaySearchRequest request = new HolidaySearchRequest(GBP);
    request.setDateToCheck(DATE_SUNDAY);
    request.setVersionCorrection(VC);
    HolidaySearchResult result = new HolidaySearchResult();
   
    when(mock.search(request)).thenReturn(result);
    MasterHolidaySource test = new MasterHolidaySource(mock, VC);
    boolean testResult = test.isHoliday(DATE_SUNDAY, GBP);
    verify(mock, times(0)).search(request);
   
    assertEquals(true, testResult);
View Full Code Here

    assertEquals(true, testResult);
  }

  //-------------------------------------------------------------------------
  public void test_isHoliday_LocalDateTypeExternalId_holiday() throws Exception {
    HolidayMaster mock = mock(HolidayMaster.class);
    HolidaySearchRequest request = new HolidaySearchRequest(HolidayType.BANK, ExternalIdBundle.of(ID));
    request.setDateToCheck(DATE_MONDAY);
    request.setVersionCorrection(VC);
    ManageableHoliday holiday = new ManageableHoliday(GBP, Collections.singletonList(DATE_MONDAY));
    HolidaySearchResult result = new HolidaySearchResult();
    result.getDocuments().add(new HolidayDocument(holiday));
   
    when(mock.search(request)).thenReturn(result);
    MasterHolidaySource test = new MasterHolidaySource(mock, VC);
    boolean testResult = test.isHoliday(DATE_MONDAY, HolidayType.BANK, ID);
    verify(mock, times(1)).search(request);
   
    assertEquals(true, testResult);
View Full Code Here

    assertEquals(true, testResult);
  }

  //-------------------------------------------------------------------------
  public void test_isHoliday_LocalDateTypeExternalIdBundle_holiday() throws Exception {
    HolidayMaster mock = mock(HolidayMaster.class);
    HolidaySearchRequest request = new HolidaySearchRequest(HolidayType.BANK, BUNDLE);
    request.setDateToCheck(DATE_MONDAY);
    request.setVersionCorrection(VC);
    ManageableHoliday holiday = new ManageableHoliday(GBP, Collections.singletonList(DATE_MONDAY));
    HolidaySearchResult result = new HolidaySearchResult();
    result.getDocuments().add(new HolidayDocument(holiday));
   
    when(mock.search(request)).thenReturn(result);
    MasterHolidaySource test = new MasterHolidaySource(mock, VC);
    boolean testResult = test.isHoliday(DATE_MONDAY, HolidayType.BANK, BUNDLE);
    verify(mock, times(1)).search(request);
   
    assertEquals(true, testResult);
View Full Code Here

TOP

Related Classes of com.opengamma.master.holiday.HolidayMaster

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.