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)); }
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_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); }