public void UploadFromFilePathTest() { //Just to cover the test coverage IStorageContext ctx = new FirebaseStorageContext(); try { Authen(ctx); string[] lines = { "First line", "Second line", "Third line" }; string[] paths = { Path.GetTempPath(), "test2.txt" }; string tmpPath = Path.Combine(paths); File.WriteAllLines(tmpPath, lines); ctx.UploadFile("unit_test/test2.txt", tmpPath); //For test coverage ctx.DownloadFile("unit_test/test.txt", ""); } catch { Assert.Fail("File upload failed !!!"); } }
public void UploadFromFileStreamTest() { //Just to cover the test coverage IStorageContext ctx = new FirebaseStorageContext(); try { Authen(ctx); var stream = new MemoryStream(Encoding.ASCII.GetBytes("Hello world!")); ctx.UploadFile("unit_test/test1.txt", stream); //For test coverage ctx.DownloadFile("unit_test/test.txt", ""); } catch { Assert.Fail("File upload failed !!!"); } }