Beispiel #1
0
        internal static void Remove(string typeOfData)
        {
            fileRepository = fileFactory.CreateFileManager(typeOfData);
            Student deletedStudent, studentToDelete;
            string  id;

            do
            {
                System.Console.WriteLine("Please enter the id of the student:");
                id = System.Console.ReadLine();
                var students = fileRepository.GetAll();
                studentToDelete = students.Find(s => s.StudentId == id);
            } while (studentToDelete == null);
            deletedStudent = fileRepository.Delete(id);
            Console.WriteLine(deletedStudent.StudentGuid.ToString());
        }
        public void DeleteTest()
        {
            var result = mockObject.Delete("1");

            Assert.AreEqual(inputStudent, result);
        }