public void WhenParseVersionThenFileVersionMatch() { var version = "$VER: Professional-File-System-III 19.2 PFS3AIO-VERSION (2.10.2018) written by Michiel Pelt and copyright (c) 1994-2012 Peltin BV"; var fileVersion = VersionReader.Parse(version); Assert.Equal("Professional-File-System-III", fileVersion.Name); Assert.Equal(19, fileVersion.Version); Assert.Equal(2, fileVersion.Revision); Assert.Equal(2, fileVersion.DateDay); Assert.Equal(10, fileVersion.DateMonth); Assert.Equal(2018, fileVersion.DateYear); }
public static RigidDiskBlock AddFileSystem(this RigidDiskBlock rigidDiskBlock, byte[] dosType, byte[] fileSystemBytes) { var version = VersionReader.Read(fileSystemBytes); var fileVersion = VersionReader.Parse(version); var fileSystemHeaderBlock = BlockHelper.CreateFileSystemHeaderBlock(dosType, fileVersion.Version, fileVersion.Revision, fileSystemBytes); rigidDiskBlock.FileSystemHeaderBlocks = rigidDiskBlock.FileSystemHeaderBlocks.Concat(new[] { fileSystemHeaderBlock }); return(rigidDiskBlock); }