Ejemplo n.º 1
0
        public void CrudManagerCanUpdateValidApplication()
        {
            // Old
            Applicant originalApplicant = CreateApplication();
            int       oldCount          = CrudManager.RetrieveAllApplications().Count;
            // Current
            Applicant applicantToEdit = originalApplicant.CreateMemberwiseClone();

            applicantToEdit.FirstName  = "Uma";
            applicantToEdit.MiddleName = "Karuna";
            applicantToEdit.Surname    = "Thurman";
            CrudManager.UpdateApplication(originalApplicant, applicantToEdit);
            // Final
            List <Applicant> finalApplicants = CrudManager.RetrieveAllApplications();
            int finalCount = finalApplicants.Count;

            // Assertions
            Assert.AreEqual(finalCount, oldCount);
            // The original remains in the database, just edited:
            Assert.False(finalApplicants.Contains(applicantToEdit));
            Assert.True(finalApplicants.Contains(originalApplicant));
        }