Exemple #1
0
            public void ReturnsTrueIfHashDoesNotExistInIndex()
            {
                // Arrange
                TestableGitPackFile file = CreateTestPackFile();

                // Act/Assert
                Assert.False(file.Exists("012345"));
            }
Exemple #2
0
            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"));
            }
Exemple #3
0
            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");
            }