Package de.timefinder.data

Source Code of de.timefinder.data.IntervalTest

/*
*  Copyright 2009 Peter Karich, peat_hal ‘at’ users ‘dot’ sourceforge ‘dot’ net.
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*  under the License.
*/
package de.timefinder.data;

import de.timefinder.data.IntervalLongImpl;
import de.timefinder.data.ICalendarSettings;
import de.timefinder.data.CalendarSettings;
import de.timefinder.data.IntervalLong;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

/**
* @author Peter Karich, peat_hal ‘at’ users ‘dot’ sourceforge ‘dot’ net
*/
public class IntervalTest {

    private CalendarSettings settings;

    @Before
    public void setUp() {
        settings = new CalendarSettings();
    }

    @Test
    public void testEventUI() {
        int slots = 8;
        settings.setTimeslotsPerDay(slots);
        settings.setMillisPerTimeslot(ICalendarSettings.HOUR);
        IntervalLong evUI = new IntervalLongImpl(settings.getStartDate().plusHours(slots - 1), 60);

        assertEquals(settings.getStartDate().plusHours(slots - 1),
                evUI.getStartDateTime());
        // should be on the same day
        assertEquals(evUI.getEndDateTime().getDayOfMonth(),
                evUI.getStartDateTime().getDayOfMonth());
    }
}
TOP

Related Classes of de.timefinder.data.IntervalTest

TOP
Copyright © 2018 www.massapi.com. 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.