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