Example #1
0
 public void RequiresNonNullorEmptyBaseName()
 {
     Assert.Throws <ArgumentException>(() => GitPackFile.Open(fs: new InMemoryFileSystem(), baseName: null))
     .WithMessage(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "baseName")
     .WithParamName("baseName");
     Assert.Throws <ArgumentException>(() => GitPackFile.Open(fs: new InMemoryFileSystem(), baseName: String.Empty))
     .WithMessage(CommonResources.Argument_Cannot_Be_Null_Or_Empty, "baseName")
     .WithParamName("baseName");
 }
Example #2
0
            public void UsesCorrectPackFile()
            {
                // Arrange
                InMemoryFileSystem fs = new InMemoryFileSystem();

                fs.WriteTestFile("pack-test.idx", w =>
                {
                    w.Write(GitPackIndex.V2PlusSignature);
                    w.Write(IPAddress.HostToNetworkOrder(2));
                });

                // Act
                GitPackFile file = GitPackFile.Open(fs, "pack-test");

                // Assert
                Assert.Equal("pack-test.pack", file.PackFileName);
                Assert.Same(fs, file.FileSystem);
            }
Example #3
0
            public void SetsUpDefaultCompressionAndDelta()
            {
                // Arrange
                InMemoryFileSystem fs = new InMemoryFileSystem();

                fs.WriteTestFile("pack-test.idx", w =>
                {
                    w.Write(GitPackIndex.V2PlusSignature);
                    w.Write(IPAddress.HostToNetworkOrder(2));
                });

                // Act
                GitPackFile file = GitPackFile.Open(fs, "pack-test");

                // Assert
                Assert.IsType <ZlibCompressionStrategy>(file.Compression);
                Assert.IsType <GitDeltaDecoder>(file.Delta);
                Assert.IsType <GitPackIndexV2>(file.Index);
            }
Example #4
0
 public void RequiresNonNullFileSystem()
 {
     Assert.Throws <ArgumentNullException>(() => GitPackFile.Open(fs: null, baseName: "foo"))
     .WithParamName("fs");
 }