|
| 1 | +/* |
| 2 | + * Copyright (C) 2025 Devicie Pty Ltd. All rights reserved. |
| 3 | + * |
| 4 | + * This file is part of PSAppDeployToolkit. |
| 5 | + * |
| 6 | + * PSAppDeployToolkit is free software: you can redistribute it and/or |
| 7 | + * modify it under the terms of the GNU Lesser General Public License |
| 8 | + * as published by the Free Software Foundation, either version 3 |
| 9 | + * of the License, or (at your option) any later version. |
| 10 | + * |
| 11 | + * PSAppDeployToolkit is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 14 | + * |
| 15 | + * See the GNU Lesser General Public License for more details. |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU Lesser General Public License |
| 18 | + * along with PSAppDeployToolkit. If not, see <https://www.gnu.org/licenses/>. |
| 19 | + */ |
| 20 | + |
| 21 | +using PSADT.SMBIOS; |
| 22 | + |
| 23 | +namespace PSADT.Tests.SMBIOS |
| 24 | +{ |
| 25 | + /// <summary> |
| 26 | + /// Contains unit tests that verify the values of the ChassisType enumeration conform to the expected specification. |
| 27 | + /// </summary> |
| 28 | + /// <remarks>Use this test class to ensure that any changes to the ChassisType enum do not inadvertently |
| 29 | + /// alter the assigned byte values. This helps maintain compatibility with external systems or standards that rely |
| 30 | + /// on specific enumeration values.</remarks> |
| 31 | + public sealed class ChassisTypeTests |
| 32 | + { |
| 33 | + /// <summary> |
| 34 | + /// Verifies that each value of the ChassisType enumeration matches its expected byte value as specified by the |
| 35 | + /// standard. |
| 36 | + /// </summary> |
| 37 | + /// <remarks>This test ensures that the underlying byte values of all ChassisType enum members |
| 38 | + /// conform to the documented specification. If the enum definitions are modified or regenerated, this test will |
| 39 | + /// detect any unintended changes to their assigned values.</remarks> |
| 40 | + [Fact] |
| 41 | + public void EnumValues_MatchSpecification() |
| 42 | + { |
| 43 | + Assert.Equal<byte>(0x01, (byte)ChassisType.Other); |
| 44 | + Assert.Equal<byte>(0x02, (byte)ChassisType.Unknown); |
| 45 | + Assert.Equal<byte>(0x03, (byte)ChassisType.Desktop); |
| 46 | + Assert.Equal<byte>(0x04, (byte)ChassisType.LowProfileDesktop); |
| 47 | + Assert.Equal<byte>(0x05, (byte)ChassisType.PizzaBox); |
| 48 | + Assert.Equal<byte>(0x06, (byte)ChassisType.MiniTower); |
| 49 | + Assert.Equal<byte>(0x07, (byte)ChassisType.Tower); |
| 50 | + Assert.Equal<byte>(0x08, (byte)ChassisType.Portable); |
| 51 | + Assert.Equal<byte>(0x09, (byte)ChassisType.Laptop); |
| 52 | + Assert.Equal<byte>(0x0A, (byte)ChassisType.Notebook); |
| 53 | + Assert.Equal<byte>(0x0B, (byte)ChassisType.HandHeld); |
| 54 | + Assert.Equal<byte>(0x0C, (byte)ChassisType.DockingStation); |
| 55 | + Assert.Equal<byte>(0x0D, (byte)ChassisType.AllInOne); |
| 56 | + Assert.Equal<byte>(0x0E, (byte)ChassisType.SubNotebook); |
| 57 | + Assert.Equal<byte>(0x0F, (byte)ChassisType.SpaceSaving); |
| 58 | + Assert.Equal<byte>(0x10, (byte)ChassisType.LunchBox); |
| 59 | + Assert.Equal<byte>(0x11, (byte)ChassisType.MainServerChassis); |
| 60 | + Assert.Equal<byte>(0x12, (byte)ChassisType.ExpansionChassis); |
| 61 | + Assert.Equal<byte>(0x13, (byte)ChassisType.SubChassis); |
| 62 | + Assert.Equal<byte>(0x14, (byte)ChassisType.BusExpansionChassis); |
| 63 | + Assert.Equal<byte>(0x15, (byte)ChassisType.PeripheralChassis); |
| 64 | + Assert.Equal<byte>(0x16, (byte)ChassisType.RaidChassis); |
| 65 | + Assert.Equal<byte>(0x17, (byte)ChassisType.RackMountChassis); |
| 66 | + Assert.Equal<byte>(0x18, (byte)ChassisType.SealedCasePc); |
| 67 | + Assert.Equal<byte>(0x19, (byte)ChassisType.MultiSystemChassis); |
| 68 | + Assert.Equal<byte>(0x1A, (byte)ChassisType.CompactPci); |
| 69 | + Assert.Equal<byte>(0x1B, (byte)ChassisType.AdvancedTca); |
| 70 | + Assert.Equal<byte>(0x1C, (byte)ChassisType.Blade); |
| 71 | + Assert.Equal<byte>(0x1D, (byte)ChassisType.BladeEnclosure); |
| 72 | + Assert.Equal<byte>(0x1E, (byte)ChassisType.Tablet); |
| 73 | + Assert.Equal<byte>(0x1F, (byte)ChassisType.Convertible); |
| 74 | + Assert.Equal<byte>(0x20, (byte)ChassisType.Detachable); |
| 75 | + Assert.Equal<byte>(0x21, (byte)ChassisType.IoTGateway); |
| 76 | + Assert.Equal<byte>(0x22, (byte)ChassisType.EmbeddedPc); |
| 77 | + Assert.Equal<byte>(0x23, (byte)ChassisType.MiniPc); |
| 78 | + Assert.Equal<byte>(0x24, (byte)ChassisType.StickPc); |
| 79 | + } |
| 80 | + } |
| 81 | +} |
0 commit comments