コード例 #1
0
        public void deleteProcessorFromDatabase()
        {
            ProcessorDataAccess dataAccess = new ProcessorDataAccess();
            Processor processor = dataAccess.GetLastEntity<Processor>();

            dataAccess.Delete(processor.Id);

            Assert.IsTrue(dataAccess.GetLastEntity<Processor>() == null || processor.Id == dataAccess.GetLastEntity<Processor>().Id);
        }
コード例 #2
0
        public void getProcessorFromDatabase()
        {
            ProcessorDataAccess dataAccess = new ProcessorDataAccess();
            ProducerDataAccess producerDataAccess = new ProducerDataAccess();
            Processor processor = new Processor();

            processor.Description = "Dies ist ein Test";
            processor.Model = "i5";
            processor.Core = 4;
            processor.CommandSet = "RISC";
            processor.Architecture = 64;
            processor.ClockRate = 3.40;
            processor.Producer = producerDataAccess.GetLastEntity<Producer>();

            dataAccess.Save(processor);
            Processor dbProcessor = dataAccess.GetLastEntity<Processor>();

            Assert.AreEqual(processor.CommandSet, dbProcessor.CommandSet);
        }