parent
2a547116ff
commit
bc604a3a53
@ -1,28 +1,11 @@
|
|||||||
package data;
|
package data;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import data.StockType;
|
||||||
|
|
||||||
public class Nyse implements StockType {
|
public class Nyse extends StockType {
|
||||||
private static final String NAME = "NYSE";
|
|
||||||
private HashSet sources;
|
|
||||||
|
|
||||||
public Nyse() {
|
public Nyse() {
|
||||||
sources = new HashSet();
|
super();
|
||||||
}
|
name = "NYSE";
|
||||||
|
|
||||||
@Override
|
|
||||||
public float[] update(String idstring) {
|
|
||||||
Iterator iterator = sources.iterator();
|
|
||||||
float[] result = new float[2];
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
//XXX
|
|
||||||
//DataSource source = (DataSource)iterator.next();
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() {
|
|
||||||
return this.NAME;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,30 @@
|
|||||||
|
import data.StockEntry;
|
||||||
|
import data.StypeMap;
|
||||||
|
import data.StockType;
|
||||||
|
import data.Nyse;
|
||||||
|
import ui.Main;
|
||||||
|
import java.io.*;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
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;
|
||||||
|
|
||||||
|
public class StockEntryTest {
|
||||||
|
private StockEntry entry;
|
||||||
|
private StypeMap smap;
|
||||||
|
private StockType nyyyse;
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
public void runBefore() {
|
||||||
|
smap = new StypeMap();
|
||||||
|
nyyyse = smap.getStype("Nyse");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testTypeAndName() {
|
||||||
|
entry = new StockEntry(nyyyse, "test");
|
||||||
|
assertTrue(entry.getTypeName().equals("NYSE"));
|
||||||
|
assertTrue(entry.getID().equals("test"));
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in new issue