public void Throw_error_when_encoding_is_invalid() { // Arrange var item = new File(AnyPath, AnyHash, AnySize, "abc123", (ContentEncoding)123); // Act & Assert Assert.That(() => item.ReadAsString(), Throws.TypeOf<InvalidOperationException>()); }
public void Read_utf8_content() { // Arrange var item = new File(AnyPath, AnyHash, AnySize, "abc123", ContentEncoding.Utf8); // Act var bytes = item.ReadAsString(); // Assert Assert.That(bytes, Is.EqualTo("abc123")); }
public void Return_empty_string_when_content_is_null() { // Arrange var item = new File(AnyPath, AnyHash, AnySize, null, ContentEncoding.Utf8); // Act var bytes = item.ReadAsString(); // Assert Assert.That(bytes, Is.Empty); }