Exemple #1
0
 public async Task UploadAsync_throws_if_the_local_file_cannot_be_found()
 {
     AffinitySession affinitySession = Util.RestClient.CreateAffinitySession();
     await UtilAssert.ThrowsExceptionWithMessageAsync <FileNotFoundException>(
         async() => { await affinitySession.UploadAsync("documents/does not exist.pdf"); },
         "File not found: \"documents/does not exist.pdf\"");
 }
Exemple #2
0
 public async Task UploadAsync_throws_if_affinitySession_is_null()
 {
     await UtilAssert.ThrowsExceptionWithMessageContainingAsync <ArgumentNullException>(
         async() => { await AffinitySessionExtensions.UploadAsync(null, "documents/example.docx"); },
         "affinitySession");
 }
Exemple #3
0
 public static void ThrowsExceptionWithMessageContaining <TException>(Action action, string expectedSubstring)
     where TException : Exception
 {
     UtilAssert.ThrowsExceptionWithMessageContaining <TException>(action, new[] { expectedSubstring });
 }