Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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 DeleteUsersTest()
        {
            DefaultDataGeneration filler = new DefaultDataGeneration();
            DataChamber           data   = new DataChamber();
            DatabaseActions       test   = new DatabaseActions(data, filler);
            Users newUser = new Users(1, "Test", "Testowy", 1908);

            test.AddUser(newUser);
            Assert.AreEqual(test.ReadUser(5), newUser);

            test.DeleteUser(5);
            Assert.IsFalse(test.ReadAllUsers().Contains(newUser));
        }
        public void ReadAllUsersTest()
        {
            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(usersList, test.ReadAllUsers());
        }