public void ReturnsTrueIfHashDoesNotExistInIndex() { // Arrange TestableGitPackFile file = CreateTestPackFile(); // Act/Assert Assert.False(file.Exists("012345")); }
public void ReturnsTrueIfHashExistsInIndex() { // Arrange byte[] hash = { 0x01, 0x23, 0x45 }; TestableGitPackFile file = CreateTestPackFile(); file.MockIndex .Setup(i => i.EntryExists(hash)) .Returns(true); // Act/Assert Assert.True(file.Exists("012345")); }
public void RequiresNonNullOrEmptyHash() { // Arrange TestableGitPackFile file = CreateTestPackFile(); // Act/Assert Assert.Throws <ArgumentException>(() => file.Exists(hash: null)) .WithMessage(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "hash") .WithParamName("hash"); Assert.Throws <ArgumentException>(() => file.Exists(hash: String.Empty)) .WithMessage(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "hash") .WithParamName("hash"); }