public void TestExists()
        {
            _gridFS.Delete(Query.Null);
            Assert.IsFalse(_gridFS.Exists("HelloWorld.txt"));

            var fileInfo = UploadHelloWorld();

            Assert.IsTrue(_gridFS.Exists("HelloWorld.txt"));
            Assert.IsTrue(_gridFS.ExistsById(fileInfo.Id));
        }
Example #2
0
        public void ExistsTest()
        {
            gridFS.Delete(Query.Null);
            Assert.IsFalse(gridFS.Exists(UploadFileName));

            var fileInfo = UploadHelloWord();

            fileInfo.Should().Not.Be.Null();
            gridFS.Exists(UploadFileName).Should().Be.True();
            gridFS.ExistsById(fileInfo.Id).Should().Be.True();

            gridFS.Exists(UploadFileName2).Should().Be.False();
        }