コード例 #1
0
 public void should_add_file_and_delete()
 {
     string file = Environment.CurrentDirectory + @"\TestFiles\智慧市政综合指挥平台.docx";
     var repository = new MongoDBFileRepository(connectionString, database);
     repository.Init();
     repository.Add(file);
     //repository.Delete(Path.GetFileName(file));
 }
コード例 #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);
 }
コード例 #3
0
        public void should_add_file_and_delete()
        {
            string file       = Environment.CurrentDirectory + @"\TestFiles\智慧市政综合指挥平台.docx";
            var    repository = new MongoDBFileRepository(connectionString, database);

            repository.Init();
            repository.Add(file);
            //repository.Delete(Path.GetFileName(file));
        }
コード例 #4
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);
        }
コード例 #5
0
        public void should_add_file_and_download_delete_by_name()
        {
            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(file);
            repository.Get(localfile, Path.GetFileName(file));
            repository.Delete(Path.GetFileName(file));

            Assert.IsTrue(File.Exists(localfile));
            File.Delete(localfile);
        }
コード例 #6
0
        public void should_add_file_and_download_delete_by_name()
        {
            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(file);
            repository.Get(localfile, Path.GetFileName(file));
            repository.Delete(Path.GetFileName(file));

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