deliverable_10
asdfasdf 6 years ago
parent ba13fcad28
commit 58c5cbe870

@ -5,35 +5,30 @@ import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import network.AlphaVantage;
public class DataSourceTest {
// private StockType testStype;
// private DataSource testSource;
//
// @BeforeEach
// public void runBefore() {
// testStype = StypeMap.getStype("NYSE");
// testSource = new DataSource("Test Source", "asdf://asdfasdf",
// "asdfasdfasdf", "asdfasdf");
// }
//
// @Test
// public void testAddDel() {
// testStype.addSource(testSource);
// testSource.delStype(testStype);
// }
//
// @Test
// public void testEqualsHash() {
// DataSource testSource2 = new DataSource("Test Source", "asdf://asdfasdf",
// "asdfasdfasdf", "asdfasdf");
// DataSource testSource3 = new DataSource("Test asdf", "asdf://asdfasdf",
// "asdfasdfasdf", "asdfasdf");
// String asdf = "asdf";
// assertEquals(testSource, testSource2);
// assertFalse(testSource.equals(testSource3));
// assertFalse(testSource.equals(asdf));
// assertEquals(testSource.hashCode(), testSource2.hashCode());
// assertFalse(testSource.hashCode() == testSource3.hashCode());
// }
private StockType testStype;
private DataSource testSource;
@BeforeEach
public void runBefore() {
testStype = StypeMap.getStype("NYSE");
testSource = new AlphaVantage();
}
@Test
public void testAddDel() {
testStype.addSource(testSource);
testSource.delStype(testStype);
}
@Test
public void testEqualsHash() {
DataSource testSource2 = new AlphaVantage();
String asdf = "asdf";
assertEquals(testSource, testSource2);
assertFalse(testSource.equals(asdf));
assertEquals(testSource.hashCode(), testSource2.hashCode());
}
}

Loading…
Cancel
Save