Exemplo n.º 1
0
        public void Delete__WithCorrectId__DeactivatesRecord()
        {
            File file = new File();

            file.Name          = "Test File";
            file.ParenFolderId = -1;
            file.IsActive      = true;
            file.FileExt       = ".txt";
            file.FileSizeInKB  = 100;
            file.CreatedBy     = 1;
            file.UploadedOn    = DateTime.Now.Truncate(TimeSpan.FromSeconds(1));

            file.Id = dao.Insert(file);


            var count       = dao.Delete(file.Id);
            var updatedFile = dao.GetById(file.Id);

            Assert.AreEqual(1, count);
            Assert.AreEqual(false, updatedFile.IsActive);
        }
Exemplo n.º 2
0
        public static int Delete(this File file)
        {
            FileDAO dao = new FileDAO();

            return(dao.Delete(file.Id));
        }