public void deleteRandomAccessMemoryFromDatabase() { RandomAccessMemoryDataAccess dataAccess = new RandomAccessMemoryDataAccess(); RandomAccessMemory randomAccessMemory = dataAccess.GetLastEntity<RandomAccessMemory>(); dataAccess.Delete(randomAccessMemory.Id); Assert.IsTrue(dataAccess.GetLastEntity<RandomAccessMemory>() == null || randomAccessMemory.Id == dataAccess.GetLastEntity<RandomAccessMemory>().Id); }
public void getRandomAccessMemoryFromDatabase() { RandomAccessMemoryDataAccess dataAccess = new RandomAccessMemoryDataAccess(); ProducerDataAccess producerDataAccess = new ProducerDataAccess(); RandomAccessMemory ram = new RandomAccessMemory(); ram.Description = "Dies ist ein Test"; ram.Memory = 8000; ram.ClockRate = 12000; ram.Producer = producerDataAccess.GetLastEntity<Producer>(); dataAccess.Save(ram); RandomAccessMemory dbRAM = dataAccess.GetLastEntity<RandomAccessMemory>(); Assert.AreEqual(ram.Memory, dbRAM.Memory); }