public void DefaultFillTest() { DefaultDataGeneration defaultDataGeneration = new DefaultDataGeneration(); DataChamber chamber = new DataChamber(); DatabaseActions databaseActions = new DatabaseActions(chamber, defaultDataGeneration); Assert.AreEqual(5, databaseActions.ReadAllCatalogs().Count); Assert.AreEqual(5, databaseActions.ReadAllUsers().Count); Assert.AreEqual(5, databaseActions.ReadAllProcessStates().Count); Assert.AreEqual(5, databaseActions.ReadAllEvents().Count); }
public void RandomFillTest() { RandomDataGeneration ranDataGeneration = new RandomDataGeneration(); DataChamber chamber = new DataChamber(); DatabaseActions databaseActions = new DatabaseActions(chamber, ranDataGeneration); Assert.AreEqual(10, databaseActions.ReadAllCatalogs().Count); Assert.AreEqual(10, databaseActions.ReadAllUsers().Count); Assert.AreEqual(10, databaseActions.ReadAllProcessStates().Count); Assert.AreEqual(10, databaseActions.ReadAllEvents().Count); }
public void ReadAllProcessStatesTest() { DefaultDataGeneration filler = new DefaultDataGeneration(); List <Users> usersList = new List <Users>(); Dictionary <int, Catalog> catalogDictionary = new Dictionary <int, Catalog>(); List <Event> eventsList = new List <Event>(); List <ProcessState> processStateList = new List <ProcessState>(); DataChamber data = new DataChamber(usersList, catalogDictionary, eventsList, processStateList); DatabaseActions test = new DatabaseActions(data, filler); Assert.AreEqual(processStateList, test.ReadAllProcessStates()); }
public void DeleteProcessStateTest() { DefaultDataGeneration filler = new DefaultDataGeneration(); DataChamber data = new DataChamber(); DatabaseActions test = new DatabaseActions(data, filler); Catalog newCatalog = new Catalog("Lokok", "Test", 1908, "Testowy", 9); ProcessState newProcessState = new ProcessState(newCatalog, "Testowy", 1789, "Bad"); test.AddProcessState(newProcessState); Assert.AreEqual(test.ReadProcessState(5), newProcessState); test.DeleteProcessState(5); Assert.IsFalse(test.ReadAllProcessStates().Contains(newProcessState)); }