Пример #1
0
        public void GetCompressedAssetFileName_ValidFilePath_ReturnsNewFilename(string fileName)
        {
            var result = AssetCompression.GetCompressedAssetFileName(fileName, false);

            Check.That(result)
            .IsNotNull()
            .And.IsEqualTo("this_is_a_file.lz");
        }
Пример #2
0
        public void CompressAsset_InvalidTargetFilePath_ReturnsFalse()
        {
            const string sourceFilePath = "test_file.txt";

            _assetCompression.Get <IFile>()
            .Exists(sourceFilePath)
            .Returns(true);
            _assetCompression.Get <IFile>()
            .Exists(AssetCompression.GetCompressedAssetFileName(sourceFilePath, false))
            .Returns(true);

            var result = _assetCompression.ClassUnderTest.CompressAsset(sourceFilePath, string.Empty, overwrite: false);

            Check.That(result).IsFalse();
        }
        private bool GetCompressedDatabaseFilePathIfExists(out string compressedFilePath, bool encrypted)
        {
            compressedFilePath = Path.Combine(_fileSystemService.GetLocalPathToDataFolder(), AssetCompression.GetCompressedAssetFileName(Constants.AllMyBricksDbFile, encrypted));

            return(_file.Exists(compressedFilePath));
        }
Пример #4
0
        public void GetCompressedAssetFileName_InvalidFilePath_ReturnsNull(string fileName)
        {
            var result = AssetCompression.GetCompressedAssetFileName(fileName, false);

            Check.That(result).IsNull();
        }