public void should_add_file_and_delete_by_id()
 {
     string id = Guid.NewGuid().ToString();
     string file = Environment.CurrentDirectory + @"\TestFiles\智慧市政综合指挥平台.docx";
     var repository = new MongoDBFileRepository(connectionString, database);
     repository.Init();
     repository.Add(id, file);
     repository.DeleteById(id);
 }
Пример #2
0
        public void should_add_file_and_delete_by_id()
        {
            string id         = Guid.NewGuid().ToString();
            string file       = Environment.CurrentDirectory + @"\TestFiles\智慧市政综合指挥平台.docx";
            var    repository = new MongoDBFileRepository(connectionString, database);

            repository.Init();
            repository.Add(id, file);
            repository.DeleteById(id);
        }
        public void should_add_file_and_download_delete_by_id()
        {
            string id = Guid.NewGuid().ToString();
            string file = Environment.CurrentDirectory + @"\TestFiles\智慧市政综合指挥平台.docx";
            string localfile = Environment.CurrentDirectory + @"\TestFiles\智慧市政综合指挥平台local.docx";
            var repository = new MongoDBFileRepository(connectionString, database);
            repository.Init();
            repository.Add(id, file);
            repository.GetById(localfile, id);
            repository.DeleteById(id);

            Assert.IsTrue(File.Exists(localfile));
            File.Delete(localfile);
        }
Пример #4
0
        public void should_add_file_and_download_delete_by_id()
        {
            string id         = Guid.NewGuid().ToString();
            string file       = Environment.CurrentDirectory + @"\TestFiles\智慧市政综合指挥平台.docx";
            string localfile  = Environment.CurrentDirectory + @"\TestFiles\智慧市政综合指挥平台local.docx";
            var    repository = new MongoDBFileRepository(connectionString, database);

            repository.Init();
            repository.Add(id, file);
            repository.GetById(localfile, id);
            repository.DeleteById(id);

            Assert.IsTrue(File.Exists(localfile));
            File.Delete(localfile);
        }