コード例 #1
0
 public void ExistsThrowsOnNullOrEmptyHash()
 {
     GitLooseFilesDictionary dict = new GitLooseFilesDictionary(new InMemoryFileSystem(), new NullCompressionStrategy());
     Assert.Throws<ArgumentException>(() => dict.Exists(null))
           .WithParamName("hash");
     Assert.Throws<ArgumentException>(() => dict.Exists(String.Empty))
           .WithParamName("hash");
 }
コード例 #2
0
        public void ExistsReturnsTrueIfHashFileExists()
        {
            // Arrange
            InMemoryFileSystem fs = new InMemoryFileSystem();
            GitLooseFilesDictionary db = new GitLooseFilesDictionary(fs, new NullCompressionStrategy());
            fs.WriteTestFile(@"ab\cdefghijk", "Foo");

            // Act/Assert
            Assert.True(db.Exists("abcdefghijk"));
        }
コード例 #3
0
        public void ExistsReturnsFalseIfHashFileDoesNotExist()
        {
            // Arrange
            InMemoryFileSystem fs = new InMemoryFileSystem();
            GitLooseFilesDictionary db = new GitLooseFilesDictionary(fs, new NullCompressionStrategy());

            // Assume
            Assert.False(fs.Exists(@"ab\cdefghijk"));

            // Act/Assert
            Assert.False(db.Exists("abcdefghijk"));
        }