mirror of
https://github.com/alibaba/testable-mock.git
synced 2025-01-07 19:00:45 +08:00
add test case of basic type constructing
This commit is contained in:
parent
ea4c6c5b3e
commit
fcbdb7275b
@ -1,5 +1,6 @@
|
||||
package com.alibaba.testable.core.tool;
|
||||
|
||||
import com.alibaba.testable.core.model.LogLevel;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
@ -13,4 +14,12 @@ class OmniConstructorTest {
|
||||
assertEquals(1, demoParent.c.gc.get());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_handle_basic_types() {
|
||||
assertEquals(0, OmniConstructor.newInstance(int.class));
|
||||
assertEquals(0L, OmniConstructor.newInstance(Long.class));
|
||||
assertEquals("", OmniConstructor.newInstance(String.class));
|
||||
assertEquals(LogLevel.DISABLE, OmniConstructor.newInstance(LogLevel.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user