Click or drag to resize
FakeStorageProvider Class
Testing IO storage provider. Usage example: [Test] public void SampleTestMethod() { TestStorageProvider provider = TestStorageProvider.GetMappedProvider(); provider.FileObject.ReadAllText("path").ReturnsForAnyArgs("text"); string result = CMS.IO.File.ReadAllText("path"); Assert.AreEqual("text", result); }
Inheritance Hierarchy

Namespace: CMS.Tests
Assembly: CMS.Tests (in CMS.Tests.dll) Version: 8.2.23
Syntax
C#
public class FakeStorageProvider : AbstractStorageProvider

The FakeStorageProvider type exposes the following members.

Methods
  NameDescription
Protected methodCreateDirectoryProviderObject
Creates new directory provider object
(Overrides AbstractStorageProviderCreateDirectoryProviderObject.)
Protected methodCreateFileProviderObject
Creates new directory provider object
(Overrides AbstractStorageProviderCreateFileProviderObject.)
Public methodGetDirectoryInfo
Returns new instance of directory info.
(Overrides AbstractStorageProviderGetDirectoryInfo(String).)
Public methodGetFileInfo
Returns new instance of FileInfo object.
(Overrides AbstractStorageProviderGetFileInfo(String).)
Public methodGetFileStream(String, FileMode)
Returns new instance of file stream.
(Overrides AbstractStorageProviderGetFileStream(String, FileMode).)
Public methodGetFileStream(String, FileMode, FileAccess)
Returns new instance of file stream.
(Overrides AbstractStorageProviderGetFileStream(String, FileMode, FileAccess).)
Public methodGetFileStream(String, FileMode, FileAccess, FileShare)
Returns new instance of file stream.
(Overrides AbstractStorageProviderGetFileStream(String, FileMode, FileAccess, FileShare).)
Public methodGetFileStream(String, FileMode, FileAccess, FileShare, Int32)
Returns new instance of file stream.
(Overrides AbstractStorageProviderGetFileStream(String, FileMode, FileAccess, FileShare, Int32).)
Protected methodGetFullPath
Converts the external mapped path to the internal path of the provider
(Inherited from AbstractStorageProvider.)
Protected methodGetInternalProvider
Gets the storage provider based on the given path
(Inherited from AbstractStorageProvider.)
Public methodStatic memberGetMappedProvider
Returns new instance of TestStorageProvider and maps provider to given path.
Protected methodGetStorageProviderInternal
Gets the storage provider based on the given path
(Inherited from AbstractStorageProvider.)
Public methodMapStoragePath
Maps the given storage path to a specific provider
(Inherited from AbstractStorageProvider.)
Protected methodRemoveMappedProvider
Removes a mapped provider from the mapped collection
(Inherited from AbstractStorageProvider.)
Public methodUnMapStoragePath
Removes the mapping to a storage provider
(Inherited from AbstractStorageProvider.)
Top
Extension Methods
  NameDescription
Public Extension MethodAsValue
Converts object to a query value which can be used as a query parameter
(Defined by QueryExtensions.)
Public Extension MethodGetAPIString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodGetString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodToBoolean
Returns the boolean representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDateTime
Returns the DateTime representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDouble
Returns the double representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToGuid
Returns the Guid representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToInteger
Returns the integer representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToString
Returns the string representation of an object or default value if not.
(Defined by CoreExtensions.)
Top
Properties
  NameDescription
Public propertyCustomRootPath
Gets or sets Custom path where files should be stored.
(Inherited from AbstractStorageProvider.)
Public propertyCustomRootUrl
Specifies custom root URL for provider.
(Inherited from AbstractStorageProvider.)
Public propertyDirectoryInfoObject
DirectoryInfo object.
Public propertyDirectoryObject
Directory object.
Public propertyDirectoryProviderObject
Returns CMSDirectoryProvider object.
(Inherited from AbstractStorageProvider.)
Public propertyExternalStorageName
Returns name of external storage (if current instance running on external storage).
(Inherited from AbstractStorageProvider.)
Public propertyFileInfoObject
FileInfo object.
Public propertyFileObject
File object.
Public propertyFileProviderObject
Returns AbstractFile object.
(Inherited from AbstractStorageProvider.)
Public propertyFileStreamObject
FileStream object.
Public propertyHasCustomRootPath
Returns whether provider has custom root path.
(Inherited from AbstractStorageProvider.)
Public propertyIsExternalStorage
Returns whether current instance running on external storage.
(Inherited from AbstractStorageProvider.)
Protected propertyMappedPath
Mapped path
(Inherited from AbstractStorageProvider.)
Public propertyName
Provider name
(Inherited from AbstractStorageProvider.)
Protected propertyParentStorageProvider
Parent storage provider
(Inherited from AbstractStorageProvider.)
Protected propertyProviderAssembly
Custom Provider library assembly.
(Inherited from AbstractStorageProvider.)
Protected propertyProviderAssemblyName
Custom Provider library assembly.
(Inherited from AbstractStorageProvider.)
Public propertyPublicExternalFolderObject
Gets or sets whether external storage folder object (i.e. Container for WA blob storage) has public access or not.
(Inherited from AbstractStorageProvider.)
Protected propertyStartingPath
Starting path that the provider will use as prefix in case it is used
(Inherited from AbstractStorageProvider.)
Top
See Also