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"); }
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); }
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); }
public void RequiresNonNullFileSystem() { Assert.Throws <ArgumentNullException>(() => GitPackFile.Open(fs: null, baseName: "foo")) .WithParamName("fs"); }