示例#1
0
        public void AnatomyManager_DeleteAnatomy()
        {
            AnatomyManager m = new AnatomyManager(new TreeMonDbContext(connectionKey));
            Anatomy        s = new Anatomy()
            {
                AccountId   = "a",
                Name        = "DELETERECORD",
                CreatedBy   = "TESTUSER",
                DateCreated = DateTime.UtcNow
            };

            m.Insert(s);

            //Test the delete flag
            Assert.IsTrue(m.DeleteAnatomy(s) > 0);
            m.GetAnatomy("DELETERECORD");
            Anatomy d = m.GetAnatomy("DELETERECORD");

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


            Assert.IsTrue(m.DeleteAnatomy(s, true) > 0);
            d = m.GetAnatomy("DELETERECORD");
            Assert.IsNull(d);
        }
示例#2
0
        public void AnatomyManager_GetAnatomyBy()
        {
            AnatomyManager m = new AnatomyManager(new TreeMonDbContext(connectionKey));
            Anatomy        s = m.GetAnatomy("TESTRECORD");

            Assert.IsNotNull(s);
            Anatomy suid = m.GetAnatomyBy(s.UUID);

            Assert.IsNotNull(suid);
        }
示例#3
0
        public void AnatomyManager_UpdateAnatomy()
        {
            AnatomyManager m = new AnatomyManager(new TreeMonDbContext(connectionKey));

            m.Insert(new Anatomy()
            {
                AccountId = "a",
                Name      = "TESTRECORD",
                UUID      = Guid.NewGuid().ToString("N")
            });
            Anatomy s = m.GetAnatomy("TESTRECORD");

            s.Name = "UPDATEDRECORD";

            Assert.AreEqual(m.UpdateAnatomy(s).Code, 200);
            Anatomy u = m.GetAnatomy("UPDATEDRECORD");

            Assert.IsNotNull(u);
        }
示例#4
0
        public void AnatomyManager_GetAnatomy()
        {
            AnatomyManager m  = new AnatomyManager(new TreeMonDbContext(connectionKey));
            ServiceResult  sr = m.Insert(new Anatomy()
            {
                AccountId   = "a",
                Name        = "ALPHA",
                DateCreated = DateTime.UtcNow
            }, false);

            Assert.AreEqual(sr.Code, 200, sr.Message);
            Anatomy s = m.GetAnatomy("ALPHA");

            Assert.IsNotNull(s);
        }