Package name.pehl.karaka.shared.model

Examples of name.pehl.karaka.shared.model.Duration


    {
        String[] times = new String[] {"1m", "01m", "1.2m", "01.2m", "1.22m", "01.22m", "1,2m", "01,2m", "1,22m",
                "01,22m"};
        for (String time : times)
        {
            Duration duration = cut.parse(time);
            assertEquals("Error parsing " + time, 0, duration.getHours());
            assertEquals("Error parsing " + time, 1, duration.getMinutes());
        }
    }
View Full Code Here


    public void hoursAndMinutesOk() throws ParseException
    {
        String[] timesWithPoint = new String[] {"1.2", "1.20", "01.2", "01.20", "1.2h", "1.20h", "01.2h", "01.20h"};
        for (String time : timesWithPoint)
        {
            Duration duration = cut.parse(time);
            assertEquals("Error parsing " + time, 1, duration.getHours());
            assertEquals("Error parsing " + time, 12, duration.getMinutes());
        }

        String[] timesWithComma = new String[] {"1,2", "1,20", "01,2", "01,20", "1,2h", "1,20h", "01,2h", "01,20h"};
        for (String time : timesWithComma)
        {
            Duration duration = cut.parse(time);
            assertEquals("Error parsing " + time, 1, duration.getHours());
            assertEquals("Error parsing " + time, 12, duration.getMinutes());
        }

        String[] timesWithColumn = new String[] {"1:2", "1:02", "1:2h", "1:02h", "1:2m", "1:02m"};
        for (String time : timesWithColumn)
        {
            Duration duration = cut.parse(time);
            assertEquals("Error parsing " + time, 1, duration.getHours());
            assertEquals("Error parsing " + time, 2, duration.getMinutes());
        }
        timesWithColumn = new String[] {"1:20", "01:20", "1:20h", "01:20h", "1:20m", "01:20m"};
        for (String time : timesWithColumn)
        {
            Duration duration = cut.parse(time);
            assertEquals("Error parsing " + time, 1, duration.getHours());
            assertEquals("Error parsing " + time, 20, duration.getMinutes());
        }
    }
View Full Code Here

    // --------------------------------------------------------- helper methods

    @SuppressWarnings("unchecked")
    void prepareGetMinutes()
    {
        final GetDurationsResult getDurationsResult = new GetDurationsResult(new Durations(new Duration(1), new Duration(2),
                new Duration(3)));
        Answer<Object> getDurationsAnswer = new Answer<Object>()
        {
            @Override
            public Object answer(InvocationOnMock invocation)
            {
View Full Code Here

    }


    void verifyGetDurations()
    {
        verify(view).updateDurations(new Durations(new Duration(1), new Duration(2), new Duration(3)));
    }
View Full Code Here

TOP

Related Classes of name.pehl.karaka.shared.model.Duration

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.