// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename       : MaxiDisk.cs
// Author(s)      : Natalia Portillo <claunia@claunia.com>
//
// Component      : Aaru unit testing.
//
// --[ License ] --------------------------------------------------------------
//
//     This program is free software: you can redistribute it and/or modify
//     it under the terms of the GNU General Public License as
//     published by the Free Software Foundation, either version 3 of the
//     License, or (at your option) any later version.
//
//     This program is distributed in the hope that it will be useful,
//     but WITHOUT ANY WARRANTY; without even the implied warranty of
//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//     GNU General Public License for more details.
//
//     You should have received a copy of the GNU General Public License
//     along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2023 Natalia Portillo
// ****************************************************************************/

using System.IO;
using Aaru.CommonTypes;
using Aaru.CommonTypes.Interfaces;
using NUnit.Framework;

namespace Aaru.Tests.Images
{
    [TestFixture]
    public class MaxiDisk : BlockMediaImageTest
    {
        public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Media image formats", "MaxiDisk");
        public override IMediaImage _plugin => new DiscImages.MaxiDisk();

        public override BlockImageTestExpected[] Tests => new[]
        {
            new BlockImageTestExpected
            {
                TestFile   = "3DF800.HDK.lz",
                MediaType  = MediaType.CBM_35_DD,
                Sectors    = 1600,
                SectorSize = 512,
                MD5        = "26532a62985b51a2c3b877a57f6d257b",
                Partitions = new[]
                {
                    new BlockPartitionVolumes
                    {
                        Start  = 0,
                        Length = 1600
                    }
                }
            },
            new BlockImageTestExpected
            {
                TestFile   = "3DS.HDK.lz",
                MediaType  = MediaType.DOS_35_DS_DD_9,
                Sectors    = 1440,
                SectorSize = 512,
                MD5        = "9827ba1b3e9cac41263caabd862e78f9",
                Partitions = new[]
                {
                    new BlockPartitionVolumes
                    {
                        Start  = 0,
                        Length = 1440
                    }
                }
            },
            new BlockImageTestExpected
            {
                TestFile   = "3ES.HDK.lz",
                MediaType  = MediaType.ECMA_147,
                Sectors    = 5760,
                SectorSize = 512,
                MD5        = "4aeafaf2a088d6a7406856dce8118567",
                Partitions = new[]
                {
                    new BlockPartitionVolumes
                    {
                        Start  = 0,
                        Length = 5760
                    }
                }
            },
            new BlockImageTestExpected
            {
                TestFile   = "3HD6.HDK.lz",
                MediaType  = MediaType.DMF,
                Sectors    = 3360,
                SectorSize = 512,
                MD5        = "2bfd2e0a81bad704f8fc7758358cfcca",
                Partitions = new[]
                {
                    new BlockPartitionVolumes
                    {
                        Start  = 0,
                        Length = 3360
                    }
                }
            },
            new BlockImageTestExpected
            {
                TestFile   = "3HF168.HDK.lz",
                MediaType  = MediaType.DMF,
                Sectors    = 3360,
                SectorSize = 512,
                MD5        = "7e3bf04f3660dd1052a335dc99441e44",
                Partitions = new[]
                {
                    new BlockPartitionVolumes
                    {
                        Start  = 0,
                        Length = 3360
                    }
                }
            },
            new BlockImageTestExpected
            {
                TestFile   = "3HF16.HDK.lz",
                MediaType  = MediaType.Unknown,
                Sectors    = 3200,
                SectorSize = 512,
                MD5        = "8eb8cb310feaf03c69fffd4f6e729847",
                Partitions = new[]
                {
                    new BlockPartitionVolumes
                    {
                        Start  = 0,
                        Length = 3200
                    }
                }
            },
            new BlockImageTestExpected
            {
                TestFile   = "3HF172.HDK.lz",
                MediaType  = MediaType.FDFORMAT_35_HD,
                Sectors    = 3444,
                SectorSize = 512,
                MD5        = "a58fd062f024b95714f1223a8bc2232f",
                Partitions = new[]
                {
                    new BlockPartitionVolumes
                    {
                        Start  = 0,
                        Length = 3444
                    }
                }
            },
            new BlockImageTestExpected
            {
                TestFile   = "3HS.HDK.lz",
                MediaType  = MediaType.DOS_35_HD,
                Sectors    = 2880,
                SectorSize = 512,
                MD5        = "00e61c06bf29f0c04a7eabe2dbd7efb6",
                Partitions = new[]
                {
                    new BlockPartitionVolumes
                    {
                        Start  = 0,
                        Length = 2880
                    }
                }
            },
            new BlockImageTestExpected
            {
                TestFile   = "5DS18.HDK.lz",
                MediaType  = MediaType.DOS_525_SS_DD_8,
                Sectors    = 320,
                SectorSize = 512,
                MD5        = "d81f5cb64fd0b99f138eab34110bbc3c",
                Partitions = new[]
                {
                    new BlockPartitionVolumes
                    {
                        Start  = 0,
                        Length = 320
                    }
                }
            },
            new BlockImageTestExpected
            {
                TestFile   = "5DS1.HDK.lz",
                MediaType  = MediaType.DOS_525_SS_DD_9,
                Sectors    = 360,
                SectorSize = 512,
                MD5        = "a89006a75d13bee9202d1d6e52721ccb",
                Partitions = new[]
                {
                    new BlockPartitionVolumes
                    {
                        Start  = 0,
                        Length = 360
                    }
                }
            },
            new BlockImageTestExpected
            {
                TestFile   = "5DS28.HDK.lz",
                MediaType  = MediaType.DOS_525_DS_DD_8,
                Sectors    = 640,
                SectorSize = 512,
                MD5        = "beef1cdb004dc69391d6b3d508988b95",
                Partitions = new[]
                {
                    new BlockPartitionVolumes
                    {
                        Start  = 0,
                        Length = 640
                    }
                }
            },
            new BlockImageTestExpected
            {
                TestFile   = "5DS2.HDK.lz",
                MediaType  = MediaType.DOS_525_DS_DD_9,
                Sectors    = 720,
                SectorSize = 512,
                MD5        = "6213897b7dbf263f12abf76901d43862"
            },
            new BlockImageTestExpected
            {
                TestFile   = "5HF144.HDK.lz",
                MediaType  = MediaType.DOS_35_HD,
                Sectors    = 2880,
                SectorSize = 512,
                MD5        = "073a172879a71339ef4b00ebb47b67fc",
                Partitions = new[]
                {
                    new BlockPartitionVolumes
                    {
                        Start  = 0,
                        Length = 2880
                    }
                }
            },
            new BlockImageTestExpected
            {
                TestFile   = "5HS.HDK.lz",
                MediaType  = MediaType.DOS_525_HD,
                Sectors    = 2400,
                SectorSize = 512,
                MD5        = "02259cd5fbcc20f8484aa6bece7a37c6",
                Partitions = new[]
                {
                    new BlockPartitionVolumes
                    {
                        Start  = 0,
                        Length = 2400
                    }
                }
            }
        };
    }
}