mirror of
https://github.com/alibaba/testable-mock.git
synced 2025-01-09 11:50:40 +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;
|
package com.alibaba.testable.core.tool;
|
||||||
|
|
||||||
|
import com.alibaba.testable.core.model.LogLevel;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
@ -13,4 +14,12 @@ class OmniConstructorTest {
|
|||||||
assertEquals(1, demoParent.c.gc.get());
|
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