ReturnsMoreEmptyValuesTest.java revision 2637d96c202372854a7c71466ddcc6e90fc4fc53
1/*
2 * Copyright (c) 2007 Mockito contributors
3 * This program is made available under the terms of the MIT License.
4 */
5package org.mockito.internal.stubbing.defaultanswers;
6
7import org.junit.Test;
8import org.mockitoutil.TestBase;
9
10import static junit.framework.TestCase.assertEquals;
11import static junit.framework.TestCase.assertTrue;
12
13public class ReturnsMoreEmptyValuesTest extends TestBase {
14
15    private ReturnsMoreEmptyValues rv = new ReturnsMoreEmptyValues();
16
17    @Test
18    public void shouldReturnEmptyArray() {
19        String[] ret = (String[]) rv.returnValueFor((new String[0]).getClass());
20        assertTrue(ret.getClass().isArray());
21        assertTrue(ret.length == 0);
22    }
23
24    @Test
25    public void shouldReturnEmptyString() {
26        assertEquals("", rv.returnValueFor(String.class));
27    }
28}
29