Example #1
0
        public void FileExistsWithEmptyVirtualPath()
        {
            // Arrange
            bool expected = false;
            var  settings = this.Settings;
            IVirtualImageProvider target = new MongoReaderPlugin(settings);

            // Act
            var actual = target.FileExists(string.Empty, null);

            // Assert
            Assert.Equal <bool>(expected, actual);
        }
Example #2
0
        public void FileExistsWithNullVirtualPath()
        {
            // Arrange
            var settings = this.Settings;
            IVirtualImageProvider target = new MongoReaderPlugin(settings);

            // Act
            var actual = Assert.Throws <NullReferenceException>(() => target.FileExists(null, null));

            // Assert
            Assert.NotNull(actual);
            Assert.IsType <NullReferenceException>(actual);
        }
Example #3
0
        public void FileExistFileNotExisting()
        {
            // Arrange
            bool   expected              = true;
            var    settings              = this.Settings;
            string virtualPath           = Path.Combine(settings["prefix"], dummyDatabaseRecordId.ToString("B"));
            IVirtualImageProvider target = new MongoReaderPlugin(settings);

            // Act
            bool actual = target.FileExists(virtualPath, new NameValueCollection());

            // Assert
            Assert.Equal <bool>(expected, actual);
        }
Example #4
0
        public void FileExistsWithoutVirtualPath()
        {
            // Arrange
            bool   expected              = false;
            var    settings              = this.Settings;
            string virtualPath           = dummyDatabaseRecordId.ToString("B");
            IVirtualImageProvider target = new MongoReaderPlugin(settings);

            // Act
            bool actual = target.FileExists(virtualPath, null);

            // Assert
            Assert.Equal <bool>(expected, actual);
        }
Example #5
0
        public void FileExistsFileExisting()
        {
            // Arrange
            string id                    = this.CreateFileInDatabase();
            bool   expected              = true;
            var    settings              = this.Settings;
            string virtualPath           = Path.Combine(settings["prefix"], id);
            IVirtualImageProvider target = new MongoReaderPlugin(settings);

            // Act
            bool actual = target.FileExists(virtualPath, new NameValueCollection());

            // Assert
            Assert.Equal <bool>(expected, actual);
        }