Skip to content

Commit

Permalink
Update unit test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
poulad committed Sep 2, 2018
1 parent 694f581 commit d6893e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
max_jobs: 1
branches:
except:
- gh-pages
Expand Down
14 changes: 7 additions & 7 deletions test/UnitTests/Decryption/FileStreamDecryptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public async Task Should_Throw_If_Null_EncryptedContent()
decrypter.DecryptFileAsync(null, null, null)
);

Assert.Equal("Value cannot be null.\nParameter name: encryptedContent", exception.Message);
Assert.Matches(@"^Value cannot be null.\s+Parameter name: encryptedContent$", exception.Message);
Assert.IsType<ArgumentNullException>(exception);
}

Expand All @@ -187,7 +187,7 @@ public async Task Should_Throw_If_Null_FileCredentials()
decrypter.DecryptFileAsync(new MemoryStream(), null, null)
);

Assert.Equal("Value cannot be null.\nParameter name: fileCredentials", exception.Message);
Assert.Matches(@"^Value cannot be null.\s+Parameter name: fileCredentials$", exception.Message);
Assert.IsType<ArgumentNullException>(exception);
}

Expand All @@ -199,7 +199,7 @@ public async Task Should_Throw_If_Null_Secret()
decrypter.DecryptFileAsync(new MemoryStream(), new FileCredentials(), new MemoryStream())
);

Assert.Equal("Value cannot be null.\nParameter name: Secret", exception.Message);
Assert.Matches(@"^Value cannot be null.\s+Parameter name: Secret$", exception.Message);
Assert.IsType<ArgumentNullException>(exception);
}

Expand All @@ -213,7 +213,7 @@ public async Task Should_Throw_If_Null_Hash()
decrypter.DecryptFileAsync(new MemoryStream(), fileCredentials, new MemoryStream())
);

Assert.Equal("Value cannot be null.\nParameter name: FileHash", exception.Message);
Assert.Matches(@"^Value cannot be null.\s+Parameter name: FileHash$", exception.Message);
Assert.IsType<ArgumentNullException>(exception);
}

Expand All @@ -231,7 +231,7 @@ public async Task Should_Throw_If_NonReadable_Data_Stream()
);
}

Assert.Equal("Stream does not support reading.\nParameter name: encryptedContent", exception.Message);
Assert.Matches(@"^Stream does not support reading.\s+Parameter name: encryptedContent$", exception.Message);
Assert.IsType<ArgumentException>(exception);
}

Expand Down Expand Up @@ -263,7 +263,7 @@ public async Task Should_Throw_If_Null_Destination()
decrypter.DecryptFileAsync(new MemoryStream(), fileCredentials, null)
);

Assert.Equal("Value cannot be null.\nParameter name: destination", exception.Message);
Assert.Matches(@"^Value cannot be null.\s+Parameter name: destination$", exception.Message);
Assert.IsType<ArgumentNullException>(exception);
}

Expand All @@ -281,7 +281,7 @@ public async Task Should_Throw_If_NonWritable_Destination()
);
}

Assert.Equal("Stream does not support writing.\nParameter name: destination", exception.Message);
Assert.Matches(@"^Stream does not support writing.\s+Parameter name: destination$", exception.Message);
Assert.IsType<ArgumentException>(exception);
}

Expand Down

0 comments on commit d6893e5

Please sign in to comment.