예제 #1
0
        public void SymptomManager_DeleteSymptom()
        {
            SymptomManager m = new SymptomManager(new TreeMonDbContext(connectionKey));
            Symptom        s = new Symptom()
            {
                AccountId   = "a",
                Name        = "DELETERECORD",
                CreatedBy   = "TESTUSER",
                DateCreated = DateTime.UtcNow,
            };

            m.Insert(s);

            //Test the delete flag
            Assert.IsTrue(m.DeleteSymptom(s) > 0);
            m.GetSymptom("DELETERECORD");
            Symptom d = m.GetSymptom("DELETERECORD");

            Assert.IsNotNull(d);
            Assert.IsTrue(d.Deleted == true);


            Assert.IsTrue(m.DeleteSymptom(s, true) > 0);
            d = m.GetSymptom("DELETERECORD");
            Assert.IsNull(d);
        }