/*
 * This file is part of csharp-gentoodotnetinfo - .NET information tool for Gentoo.
 * Copyright (c) 2023, Maciej Barć <xgqt@riseup.net>
 * Licensed under the GNU GPL v2 License
 * SPDX-License-Identifier: GPL-2.0-or-later
 *
 * csharp-gentoodotnetinfo 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 2 of the License, or
 * (at your option) any later version.
 *
 * csharp-gentoodotnetinfo 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 csharp-gentoodotnetinfo.  If not, see <https://www.gnu.org/licenses/>.
 */

using System;
using Xunit;

using Gentoo.DotNet.GentooDotnetInfo.Info;

namespace Gentoo.DotNet.GentooDotnetInfo.Tests.Unit.Info
{

    public class DotnetRuntimeInfoFixture : IDisposable
    {

        public DotnetRuntimeInfo dotnetRuntimeInfo { get; }

        public DotnetRuntimeInfoFixture()
        {
            dotnetRuntimeInfo = new DotnetRuntimeInfo();
        }

        public void Dispose()
        {

        }

    }

    public class DotnetRuntimeInfoTest : IClassFixture<DotnetRuntimeInfoFixture>
    {

        private readonly DotnetRuntimeInfoFixture _fixture;

        public DotnetRuntimeInfoTest(DotnetRuntimeInfoFixture fixture)
        {
            _fixture = fixture;
        }

        [Fact]
        public void RuntimeIdentifier_Passes()
        {
            Exception exception = Record.Exception(() =>
            {
                return _fixture.dotnetRuntimeInfo.RuntimeIdentifier;
            });

            Assert.Null(exception);
        }

        [Fact]
        public void ProcessName_Passes()
        {
            Exception exception = Record.Exception(() =>
            {
                return _fixture.dotnetRuntimeInfo.ProcessName;
            });

            Assert.Null(exception);
        }

        [Fact]
        public void ProcessFileName_Passes()
        {
            Exception exception = Record.Exception(() =>
            {
                return _fixture.dotnetRuntimeInfo.ProcessFileName;
            });

            Assert.Null(exception);
        }

        [Fact]
        public void RuntimeDirectory_Passes()
        {
            Exception exception = Record.Exception(() =>
            {
                return _fixture.dotnetRuntimeInfo.RuntimeDirectory;
            });

            Assert.Null(exception);
        }

    }

}
