/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 */
package org.apache.maven.plugins.surefire.report;

import java.util.ArrayList;
import java.util.List;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

/**
 *
 */
@SuppressWarnings("checkstyle:magicnumber")
class ReportTestSuiteTest {
    private ReportTestSuite tSuite;

    @BeforeEach
    void setUp() {
        tSuite = new ReportTestSuite();
    }

    @Test
    void testSetTestCases() {
        ReportTestCase tCase = new ReportTestCase();

        List<ReportTestCase> tCaseList = new ArrayList<>();

        tCaseList.add(tCase);

        tSuite.setTestCases(tCaseList);

        assertEquals(tCase, tSuite.getTestCases().get(0));
    }

    @Test
    void testSetNumberedOfErrors() {
        tSuite.setNumberOfErrors(9);

        assertEquals(9, tSuite.getNumberOfErrors());
    }

    @Test
    void testSetNumberOfFailures() {
        tSuite.setNumberOfFailures(10);

        assertEquals(10, tSuite.getNumberOfFailures());
    }

    @Test
    void testSetNumberOfSkipped() {
        tSuite.setNumberOfSkipped(5);

        assertEquals(5, tSuite.getNumberOfSkipped());
    }

    @Test
    void testSetNumberOfTests() {
        tSuite.setNumberOfTests(11);

        assertEquals(11, tSuite.getNumberOfTests());
    }

    @Test
    void testSetName() {
        tSuite.setName("Suite Name");

        assertEquals("Suite Name", tSuite.getName());
    }

    @Test
    void testSetPackageName() {
        tSuite.setPackageName("Suite Package Name");

        assertEquals("Suite Package Name", tSuite.getPackageName());
    }

    @Test
    void testSetTimeElapsed() {
        tSuite.setTimeElapsed(.06f);

        assertEquals(.06f, tSuite.getTimeElapsed(), 0.0);
    }
}
