Skip to content
Snippets Groups Projects
Commit 7587d180 authored by Rhys Evans's avatar Rhys Evans
Browse files

commiting before cahngin compiler

parent 7aff5e43
No related branches found
No related tags found
1 merge request!34Resolve "As a user, I would like a town specific page which shows all trails for that town so that I can easily see my progress"
......@@ -43,8 +43,9 @@ dependencies {
// implementation 'org.springframework.dao.DataAccessException'
// https://mvnrepository.com/artifact/org.springframework/spring-core
implementation 'org.springframework:spring-core:6.0.6'
implementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.8.1'
implementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.8.1'
implementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.0.1'
implementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.0.1'
//Thanks for using https://jar-download.com
......
package Team5.SmartTowns;
import Team5.SmartTowns.Data.Calculator;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.NestedRuntimeException;
//import org.springframework.dao.DataAccessException;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.junit.platform.engine.TestDescriptor;
import org.junit.platform.commons.util.Preconditions;
import org.apache.commons.logging.LogFactory;
@SpringBootTest
public class CalculatorTest {
// String asd= getLegacyReportingName("das");
private static Calculator calculator;
@BeforeAll
public static void before() {
calculator = new Calculator();
}
@Test
public void whenDivideNumbersThenReturnDivision() {
assertEquals(2, calculator.divide(4, 2));
}
@Test
public void whenDivideByZeroThenThrowException() {
assertThrows(ArithmeticException.class, () -> calculator.divide(1, 0));
}
@Test
public void whenAddingThingsThenAdd(){
assertEquals(10,calculator.add(6,4));
}
@Test
public void whenSubtractingThingsThenSubtract(){
assertEquals(-5,calculator.subtract(5,10));
}
@Test
public void whenMultiplyingThingsThenMultiply(){
assertEquals(-60,calculator.multiply(-3,20));
}
}
//package Team5.SmartTowns;
//
//import Team5.SmartTowns.Data.Calculator;
//import org.junit.jupiter.api.BeforeAll;
//import org.junit.jupiter.api.Test;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.core.NestedRuntimeException;
////import org.springframework.dao.DataAccessException;
//
//import static org.junit.jupiter.api.Assertions.assertEquals;
//import static org.junit.jupiter.api.Assertions.assertThrows;
//import org.junit.platform.engine.TestDescriptor;
//import org.junit.platform.commons.util.Preconditions;
//import org.apache.commons.logging.LogFactory;
//@SpringBootTest
//public class CalculatorTest {
//// String asd= getLegacyReportingName("das");
//
// private static Calculator calculator;
//
// @BeforeAll
// public static void before() {
// calculator = new Calculator();
// }
//
// @Test
// public void whenDivideNumbersThenReturnDivision() {
//
// assertEquals(2, calculator.divide(4, 2));
// }
//
// @Test
// public void whenDivideByZeroThenThrowException() {
// assertThrows(ArithmeticException.class, () -> calculator.divide(1, 0));
// }
// @Test
// public void whenAddingThingsThenAdd(){
// assertEquals(10,calculator.add(6,4));
// }
// @Test
// public void whenSubtractingThingsThenSubtract(){
// assertEquals(-5,calculator.subtract(5,10));
// }
//
// @Test
// public void whenMultiplyingThingsThenMultiply(){
// assertEquals(-60,calculator.multiply(-3,20));
// }
//
//
//
//
//}
package Team5.SmartTowns;
import org.junit.jupiter.api.Test;
//import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.testng.annotations.Test;
//import org.apiguardian.api;
import static org.junit.jupiter.api.Assertions.assertEquals;
//import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.testng.AssertJUnit.assertEquals;
public class DBUnitTestCase {
int bb=4;
......
package Team5.SmartTowns;
import Team5.SmartTowns.Data.locationRepositoryJDBC;
import org.junit.jupiter.api.Test;
//import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.JdbcTest;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.jdbc.Sql;
import org.testng.annotations.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
//import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.testng.Assert.assertEquals;
@SpringBootTest
@JdbcTest
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment