-- Copyright (c) 2024 Huawei Technologies Co., Ltd.
-- openUBMC is licensed under Mulan PSL v2.
-- You can use this software according to the terms and conditions of the Mulan PSL v2.
-- You may obtain a copy of Mulan PSL v2 at:
--         http://license.coscl.org.cn/MulanPSL2
-- THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
-- EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
-- MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
-- See the Mulan PSL v2 for more details.

local fru_id_mgmt = require 'fru_management'
local lu = require 'luaunit'

function Test_Fru_Management:test_set_pcbversion()
    local obj1 = {PcbId = 2, PcbVersion = '', FruId = 0}
    fru_id_mgmt.set_pcbversion(obj1)
    lu.assertEquals(obj1.PcbVersion, '.B')
    local obj2 = {PcbId = 33, PcbVersion = '', FruId = 1}
    fru_id_mgmt.set_pcbversion(obj2)
    lu.assertEquals(obj2.PcbVersion, '.a')
    local obj3 = {PcbId = 30, PcbVersion = '', FruId = 2}
    fru_id_mgmt.set_pcbversion(obj3)
    lu.assertEquals(obj3.PcbVersion, '.A')
end