Commit f2c61419 authored by Jiawei Wang's avatar Jiawei Wang
Browse files

Nimettiin tiedosto uudelleen

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-12">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>demo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=12
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=12
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=12
package demo4;
class Calculator {
private int result;
public Calculator() {
reset();
}
public void reset() {
this.result = 0;
}
public int getResult() {
return this.result;
}
public void add(int value) {
this.result += value;
}
public void subtract(int value) {
this.result += value;
}
public void multiply(int value) {
for (int i=1; i<value; i++) {
add(value);
}
}
public void exponent(int value) {
for(int i=1; i<value; i++) {
multiply(value);
}
}
}
package demo4;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
class CalculatorTest {
@Test
void addTest() {
int add = 0;
assertTrue(add == 0);
}
@Test
void subtractTest() {
int subtract = 0;
assertTrue(subtract == 0);
}
@Test
void multiplyTest() {
int multiply = 0;
assertTrue(multiply == 0);
}
@Test
void exponentTest() {
int expont = 0;
assertTrue(expont == 0);
}
}
package demo4;
class Calculator {
private int result;
public Calculator() {
reset();
}
public void reset() {
this.result = 0;
}
public int getResult() {
return this.result;
}
public void add(int value) {
this.result += value;
}
public void subtract(int value) {
this.result += value;
}
public void multiply(int value) {
for (int i=1; i<value; i++) {
add(value);
}
}
public void exponent(int value) {
for(int i=1; i<value; i++) {
multiply(value);
}
}
}
package demo4;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
class CalculatorTest {
@Test
void addTest() {
int add = 0;
assertTrue(add == 0);
}
@Test
void subtractTest() {
int subtract = 0;
assertTrue(subtract == 0);
}
@Test
void multiplyTest() {
int multiply = 0;
assertTrue(multiply == 0);
}
@Test
void exponentTest() {
int expont = 0;
assertTrue(expont == 0);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment