diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 9b8dcc6..399148b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,17 +13,17 @@ name: "CodeQL" on: push: - branches: [ "master" ] + branches: [ "master", "dev" ] pull_request: # The branches below must be a subset of the branches above - branches: [ "master" ] + branches: [ "master", "dev" ] schedule: - cron: '45 5 * * 3' jobs: analyze: name: Analyze - runs-on: ubuntu-latest + runs-on: windows-latest permissions: actions: read contents: read diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml deleted file mode 100644 index 8647a36..0000000 --- a/.github/workflows/dotnet-desktop.yml +++ /dev/null @@ -1,115 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# This workflow will build, test, sign and package a WPF or Windows Forms desktop application -# built on .NET Core. -# To learn how to migrate your existing application to .NET Core, -# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework -# -# To configure this workflow: -# -# 1. Configure environment variables -# GitHub sets default environment variables for every workflow run. -# Replace the variables relative to your project in the "env" section below. -# -# 2. Signing -# Generate a signing certificate in the Windows Application -# Packaging Project or add an existing signing certificate to the project. -# Next, use PowerShell to encode the .pfx file using Base64 encoding -# by running the following Powershell script to generate the output string: -# -# $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte -# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt' -# -# Open the output file, SigningCertificate_Encoded.txt, and copy the -# string inside. Then, add the string to the repo as a GitHub secret -# and name it "Base64_Encoded_Pfx." -# For more information on how to configure your signing certificate for -# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing -# -# Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key". -# See "Build the Windows Application Packaging project" below to see how the secret is used. -# -# For more information on GitHub Actions, refer to https://github.com/features/actions -# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications, -# refer to https://github.com/microsoft/github-actions-for-desktop-apps - -name: .NET Core Desktop - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - - build: - - strategy: - matrix: - configuration: [Release] - - runs-on: windows-latest # For a list of available runner types, refer to - # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on - - env: - Solution_Name: HC.sln # Replace with your solution name, i.e. MyWpfApp.sln. - Test_Project_Path: ~\vHC\VhcXTests\VhcXTests.csproj # Replace with the path to your test project, i.e. MyWpfApp.Tests\MyWpfApp.Tests.csproj. - Wap_Project_Directory: vHC\HC_Reporting # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package. - Wap_Project_Path: vHC\HC_Reporting\VeeamHealthCheck.csproj # Replace with the path to your Wap project, i.e. MyWpf.App.Package\MyWpfApp.Package.wapproj. - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # Install the .NET Core workload - - name: Install .NET Core - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 7.0.x - - # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild - - name: Setup MSBuild.exe - uses: microsoft/setup-msbuild@v1.0.2 - - # Execute all unit tests in the solution - - name: Execute unit tests - run: dotnet test - - # Restore the application to populate the obj folder with RuntimeIdentifiers - - name: Restore the application - run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration - env: - Configuration: ${{ matrix.configuration }} - - # Decode the base 64 encoded pfx and save the Signing_Certificate - - name: Decode the pfx - run: | - $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}") - $certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx - [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) - - # Create the app package by building and packaging the Windows Application Packaging project - - name: Create the app package - run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} - env: - Appx_Bundle: Always - Appx_Bundle_Platforms: x86|x64 - Appx_Package_Build_Mode: StoreUpload - Configuration: ${{ matrix.configuration }} - - # Remove the pfx - - name: Remove the pfx - run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx - - # Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact - - name: Upload build artifacts - uses: actions/upload-artifact@v3 - with: - name: MSIX Package - path: ${{ env.Wap_Project_Directory }}\AppPackages diff --git a/.github/workflows/virus-scan.yml b/.github/workflows/virus-scan.yml index a654c8f..cfefebb 100644 --- a/.github/workflows/virus-scan.yml +++ b/.github/workflows/virus-scan.yml @@ -4,23 +4,37 @@ on: push: branches: - master + - dev pull_request: branches: - master + - dev jobs: virus-scan: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v2 - - name: Install ClamAV - run: sudo apt-get update && sudo apt-get install -y clamav clamav-daemon + - name: Install ClamAV + run: | + sudo apt-get update + sudo apt-get install -y clamav clamav-daemon - - name: Update ClamAV database - run: sudo freshclam + - name: Disable freshclam logging + run: | + sudo cp /etc/clamav/freshclam.conf /etc/clamav/freshclam.conf.bak + sudo sed -i 's/^UpdateLogFile/#UpdateLogFile/' /etc/clamav/freshclam.conf + # Ensure there is no logging defined + grep -q "^LogFile" /etc/clamav/freshclam.conf || echo "LogFile /dev/null" | sudo tee -a /etc/clamav/freshclam.conf - - name: Scan repository for viruses - run: sudo clamscan -r --bell -i . \ No newline at end of file + - name: Update ClamAV database + run: sudo freshclam + + - name: Restore freshclam logging (if needed) + run: sudo mv /etc/clamav/freshclam.conf.bak /etc/clamav/freshclam.conf + + - name: Scan repository for viruses + run: sudo clamscan -r --bell -i . \ No newline at end of file diff --git a/vHC/HC_Reporting/Functions/Collection/CCollections.cs b/vHC/HC_Reporting/Functions/Collection/CCollections.cs index 92aa886..e2c9f62 100644 --- a/vHC/HC_Reporting/Functions/Collection/CCollections.cs +++ b/vHC/HC_Reporting/Functions/Collection/CCollections.cs @@ -8,7 +8,6 @@ using VeeamHealthCheck.Shared; using Microsoft.Management.Infrastructure; using VeeamHealthCheck.Functions.Collection.PSCollections; -using System.Web.Services.Description; using System.Windows; namespace VeeamHealthCheck.Functions.Collection diff --git a/vHC/HC_Reporting/Functions/Collection/PSCollections/CScripts.cs b/vHC/HC_Reporting/Functions/Collection/PSCollections/CScripts.cs index 0eae3da..2452e30 100644 --- a/vHC/HC_Reporting/Functions/Collection/PSCollections/CScripts.cs +++ b/vHC/HC_Reporting/Functions/Collection/PSCollections/CScripts.cs @@ -1,11 +1,5 @@ using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.IO; -using System.Linq; using System.Management.Automation; -using System.Text; -using System.Threading.Tasks; namespace VeeamHealthCheck.Functions.Collection.PSCollections { diff --git a/vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Job Session Summary/CJobSessSummary.cs b/vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Job Session Summary/CJobSessSummary.cs index 856c1b3..61f063e 100644 --- a/vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Job Session Summary/CJobSessSummary.cs +++ b/vHC/HC_Reporting/Functions/Reporting/Html/VBR/VbrTables/Job Session Summary/CJobSessSummary.cs @@ -161,13 +161,6 @@ private List JobSessionSummaryToXml(CJobSessSummaryHelper help maxBackupSize.Add(info.MaxBackupSize); -#if DEBUG - if(info.JobName == "win10trash") - { - - } - -#endif if (info.AvgBackupSize != 0 && info.AvgDataSize != 0) { if(info.AvgDataSize > info.UsedVmSizeTB) diff --git a/vHC/HC_Reporting/Health_Check_Icon.ico b/vHC/HC_Reporting/Health_Check_Icon.ico index e8522cd..4c248de 100644 Binary files a/vHC/HC_Reporting/Health_Check_Icon.ico and b/vHC/HC_Reporting/Health_Check_Icon.ico differ diff --git a/vHC/HC_Reporting/VeeamHealthCheck.csproj b/vHC/HC_Reporting/VeeamHealthCheck.csproj index 23ae451..326245f 100644 --- a/vHC/HC_Reporting/VeeamHealthCheck.csproj +++ b/vHC/HC_Reporting/VeeamHealthCheck.csproj @@ -2,7 +2,7 @@ Exe - net7.0-windows + net8.0-windows7.0 true true AnyCPU;x64 @@ -10,12 +10,11 @@ Veeam AdamC - output.ico - 2.0.0.487 + Health_Check_Icon.ico + 2.0.0.499 False - vhc_keyfile2.pfx false - 2.0.0.487 + 2.0.0.499 full true @@ -23,6 +22,8 @@ win-x64 en-US + none + vhc_keyfile2.pfx @@ -94,7 +95,7 @@ - + PreserveNewest @@ -110,15 +111,13 @@ - + - - - + @@ -177,7 +176,7 @@ - + diff --git a/vHC/HC_Reporting/Veeam_HealthCheck_228x228.ico b/vHC/HC_Reporting/Veeam_HealthCheck_228x228.ico deleted file mode 100644 index c439af0..0000000 Binary files a/vHC/HC_Reporting/Veeam_HealthCheck_228x228.ico and /dev/null differ diff --git a/vHC/HC_Reporting/VhcGui.xaml.cs b/vHC/HC_Reporting/VhcGui.xaml.cs index 32076d7..47dc6f8 100644 --- a/vHC/HC_Reporting/VhcGui.xaml.cs +++ b/vHC/HC_Reporting/VhcGui.xaml.cs @@ -28,9 +28,7 @@ private void SetUi() { SetImportRelease(); -#if DEBUG - SetImportDebug(); -#endif + this.Title = _functions.ModeCheck(); _functions.PreRunCheck(); diff --git a/vHC/HC_Reporting/output.ico b/vHC/HC_Reporting/output.ico deleted file mode 100644 index 4c248de..0000000 Binary files a/vHC/HC_Reporting/output.ico and /dev/null differ diff --git a/vHC/VhcXTests/CArgsParserTEST.cs b/vHC/VhcXTests/CArgsParserTEST.cs index 342225e..5f6ec8a 100644 --- a/vHC/VhcXTests/CArgsParserTEST.cs +++ b/vHC/VhcXTests/CArgsParserTEST.cs @@ -1,17 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using VeeamHealthCheck.Startup; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using System.Threading.Tasks; +//using VeeamHealthCheck.Startup; -namespace VhcXTests -{ - public class CArgsParserTEST - { - [Fact] - public void ParseArgs_Default_Success() - { - } - } -} +//namespace VhcXTests +//{ +// public class CArgsParserTEST +// { +// [Fact] +// public void ParseArgs_Default_Success() +// { +// } +// } +//} diff --git a/vHC/VhcXTests/Functions/Reporting/CsvHandlers/CCsvParser_TEST.cs b/vHC/VhcXTests/Functions/Reporting/CsvHandlers/CCsvParser_TEST.cs index c9a157f..4cce407 100644 --- a/vHC/VhcXTests/Functions/Reporting/CsvHandlers/CCsvParser_TEST.cs +++ b/vHC/VhcXTests/Functions/Reporting/CsvHandlers/CCsvParser_TEST.cs @@ -1,153 +1,153 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using VeeamHealthCheck.Functions.Reporting.CsvHandlers; -using VeeamHealthCheck; -using static System.Reflection.Metadata.BlobBuilder; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using System.Threading.Tasks; +//using VeeamHealthCheck.Functions.Reporting.CsvHandlers; +//using VeeamHealthCheck; +//using static System.Reflection.Metadata.BlobBuilder; -namespace VhcXTests.Functions.Reporting.CsvHandlers -{ - public class CCsvParser_TEST - { - public CCsvParser_TEST() - { +//namespace VhcXTests.Functions.Reporting.CsvHandlers +//{ +// public class CCsvParser_TEST +// { +// public CCsvParser_TEST() +// { - } +// } - [Fact] - public void CsvParser_NoFile_ReturnNull() - { - var parser = new CCsvParser(); - CVariables._vbrDir = "\\log"; +// [Fact] +// public void CsvParser_NoFile_ReturnNull() +// { +// var parser = new CCsvParser(); +// CVariables._vbrDir = "\\log"; - Assert.Null(parser.ProxyCsvParser()); - Assert.Null(parser.SobrCsvParser()); - Assert.Null(parser.RepoCsvParser()); - Assert.Null(parser.CdpProxCsvParser()); - Assert.Null(parser.NasProxCsvParser()); - Assert.Null(parser.HvProxCsvParser()); - Assert.Null(parser.CapTierCsvParser()); - Assert.Null(parser.ConfigBackupCsvParser()); - Assert.Null(parser.ServerCsvParser()); - Assert.Null(parser.BJobCsvParser()); - Assert.Null(parser.JobCsvParser()); - Assert.Null(parser.WanParser()); - Assert.Null(parser.PluginCsvParser()); - Assert.Null(parser.HvUnProtectedReader()); - Assert.Null(parser.GetDynamicLicenseCsv()); - Assert.Null(parser.GetDynamicVbrInfo()); - Assert.Null(parser.GetDynamicConfigBackup()); - Assert.Null(parser.GetPhysProtected()); - Assert.Null(parser.GetPhysNotProtected()); - Assert.Null(parser.GetDynamicJobInfo()); - Assert.Null(parser.GetDynamicBjobs()); - Assert.Null(parser.GetDynamincConfigBackup()); - Assert.Null(parser.GetDynamincNetRules()); - Assert.Null(parser.GetDynamicRepo()); - Assert.Null(parser.GetDynamicSobrExt()); - Assert.Null(parser.GetDynamicSobr()); - Assert.Null(parser.GetDynamicCapTier()); - Assert.Null(parser.GetDynViProxy()); - Assert.Null(parser.GetDynHvProxy()); - Assert.Null(parser.GetDynNasProxy()); - Assert.Null(parser.GetDynCdpProxy()); - Assert.Null(parser.SessionCsvParser()); - Assert.Null(parser.BnrCsvParser()); - Assert.Null(parser.WaitsCsvReader()); - Assert.Null(parser.SobrExtParser()); - Assert.Null(parser.ViProtectedReader()); - Assert.Null(parser.ViUnProtectedReader()); - Assert.Null(parser.HvProtectedReader()); - Assert.Null(parser.SobrExtParser()); - Assert.Null(parser.SobrExtParser()); - Assert.Null(parser.SobrExtParser()); - CVariables._vbrDir = "\\VBR"; +// Assert.Null(parser.ProxyCsvParser()); +// Assert.Null(parser.SobrCsvParser()); +// Assert.Null(parser.RepoCsvParser()); +// Assert.Null(parser.CdpProxCsvParser()); +// Assert.Null(parser.NasProxCsvParser()); +// Assert.Null(parser.HvProxCsvParser()); +// Assert.Null(parser.CapTierCsvParser()); +// Assert.Null(parser.ConfigBackupCsvParser()); +// Assert.Null(parser.ServerCsvParser()); +// Assert.Null(parser.BJobCsvParser()); +// Assert.Null(parser.JobCsvParser()); +// Assert.Null(parser.WanParser()); +// Assert.Null(parser.PluginCsvParser()); +// Assert.Null(parser.HvUnProtectedReader()); +// Assert.Null(parser.GetDynamicLicenseCsv()); +// Assert.Null(parser.GetDynamicVbrInfo()); +// Assert.Null(parser.GetDynamicConfigBackup()); +// Assert.Null(parser.GetPhysProtected()); +// Assert.Null(parser.GetPhysNotProtected()); +// Assert.Null(parser.GetDynamicJobInfo()); +// Assert.Null(parser.GetDynamicBjobs()); +// Assert.Null(parser.GetDynamincConfigBackup()); +// Assert.Null(parser.GetDynamincNetRules()); +// Assert.Null(parser.GetDynamicRepo()); +// Assert.Null(parser.GetDynamicSobrExt()); +// Assert.Null(parser.GetDynamicSobr()); +// Assert.Null(parser.GetDynamicCapTier()); +// Assert.Null(parser.GetDynViProxy()); +// Assert.Null(parser.GetDynHvProxy()); +// Assert.Null(parser.GetDynNasProxy()); +// Assert.Null(parser.GetDynCdpProxy()); +// Assert.Null(parser.SessionCsvParser()); +// Assert.Null(parser.BnrCsvParser()); +// Assert.Null(parser.WaitsCsvReader()); +// Assert.Null(parser.SobrExtParser()); +// Assert.Null(parser.ViProtectedReader()); +// Assert.Null(parser.ViUnProtectedReader()); +// Assert.Null(parser.HvProtectedReader()); +// Assert.Null(parser.SobrExtParser()); +// Assert.Null(parser.SobrExtParser()); +// Assert.Null(parser.SobrExtParser()); +// CVariables._vbrDir = "\\VBR"; - CVariables._vb365Dir = "\\log"; - Assert.Null(parser.GetDynamicVboGlobal()); - Assert.Null(parser.GetDynamicVboProxies()); - Assert.Null(parser.GetDynamicVboRbac()); - Assert.Null(parser.GetDynamicVboJobs()); - Assert.Null(parser.GetDynamicVboProcStat()); - Assert.Null(parser.GetDynamicVboRepo()); - Assert.Null(parser.GetDynamicVboSec()); - Assert.Null(parser.GetDynVboController()); - Assert.Null(parser.GetDynVboControllerDriver()); - Assert.Null(parser.GetDynVboJobSess()); - Assert.Null(parser.GetDynVboJobStats()); - Assert.Null(parser.GetDynVboObjRepo()); - Assert.Null(parser.GetDynVboOrg()); - Assert.Null(parser.GetDynVboPerms()); - Assert.Null(parser.GetDynVboProtStat()); - Assert.Null(parser.GetDynVboLicOver()); - Assert.Null(parser.GetDynVboMbProtRep()); - Assert.Null(parser.GetDynVboMbStgConsumption()); +// CVariables._vb365Dir = "\\log"; +// Assert.Null(parser.GetDynamicVboGlobal()); +// Assert.Null(parser.GetDynamicVboProxies()); +// Assert.Null(parser.GetDynamicVboRbac()); +// Assert.Null(parser.GetDynamicVboJobs()); +// Assert.Null(parser.GetDynamicVboProcStat()); +// Assert.Null(parser.GetDynamicVboRepo()); +// Assert.Null(parser.GetDynamicVboSec()); +// Assert.Null(parser.GetDynVboController()); +// Assert.Null(parser.GetDynVboControllerDriver()); +// Assert.Null(parser.GetDynVboJobSess()); +// Assert.Null(parser.GetDynVboJobStats()); +// Assert.Null(parser.GetDynVboObjRepo()); +// Assert.Null(parser.GetDynVboOrg()); +// Assert.Null(parser.GetDynVboPerms()); +// Assert.Null(parser.GetDynVboProtStat()); +// Assert.Null(parser.GetDynVboLicOver()); +// Assert.Null(parser.GetDynVboMbProtRep()); +// Assert.Null(parser.GetDynVboMbStgConsumption()); - CVariables._vb365Dir = "\\VB365"; - } - //[Fact] - //public void CsvParser_RealFile_Success() - //{ - // var parser = new CCsvParser(); +// CVariables._vb365Dir = "\\VB365"; +// } +// //[Fact] +// //public void CsvParser_RealFile_Success() +// //{ +// // var parser = new CCsvParser(); - // Assert.NotNull(parser.SessionCsvParser()); - // Assert.NotNull(parser.BnrCsvParser()); - // Assert.NotNull(parser.SobrExtParser()); - // Assert.NotNull(parser.WaitsCsvReader()); - // Assert.NotNull(parser.ViProtectedReader()); - // Assert.NotNull(parser.ViUnProtectedReader()); - // Assert.NotNull(parser.HvProtectedReader()); - // Assert.NotNull(parser.HvUnProtectedReader()); - // Assert.NotNull(parser.RegOptionsCsvParser()); - // Assert.NotNull(parser.ConfigBackupCsvParser()); - // Assert.NotNull(parser.NetTrafficCsvParser()); - // Assert.NotNull(parser.CapTierCsvParser()); - // Assert.NotNull(parser.PluginCsvParser()); - // Assert.NotNull(parser.WanParser()); - // Assert.NotNull(parser.JobCsvParser()); - // Assert.NotNull(parser.BJobCsvParser()); - // Assert.NotNull(parser.ServerCsvParser()); - // Assert.NotNull(parser.ProxyCsvParser()); - // Assert.NotNull(parser.SobrCsvParser()); - // Assert.NotNull(parser.RepoCsvParser()); - // Assert.NotNull(parser.CdpProxCsvParser()); - // Assert.NotNull(parser.HvProxCsvParser()); - // Assert.NotNull(parser.NasProxCsvParser()); +// // Assert.NotNull(parser.SessionCsvParser()); +// // Assert.NotNull(parser.BnrCsvParser()); +// // Assert.NotNull(parser.SobrExtParser()); +// // Assert.NotNull(parser.WaitsCsvReader()); +// // Assert.NotNull(parser.ViProtectedReader()); +// // Assert.NotNull(parser.ViUnProtectedReader()); +// // Assert.NotNull(parser.HvProtectedReader()); +// // Assert.NotNull(parser.HvUnProtectedReader()); +// // Assert.NotNull(parser.RegOptionsCsvParser()); +// // Assert.NotNull(parser.ConfigBackupCsvParser()); +// // Assert.NotNull(parser.NetTrafficCsvParser()); +// // Assert.NotNull(parser.CapTierCsvParser()); +// // Assert.NotNull(parser.PluginCsvParser()); +// // Assert.NotNull(parser.WanParser()); +// // Assert.NotNull(parser.JobCsvParser()); +// // Assert.NotNull(parser.BJobCsvParser()); +// // Assert.NotNull(parser.ServerCsvParser()); +// // Assert.NotNull(parser.ProxyCsvParser()); +// // Assert.NotNull(parser.SobrCsvParser()); +// // Assert.NotNull(parser.RepoCsvParser()); +// // Assert.NotNull(parser.CdpProxCsvParser()); +// // Assert.NotNull(parser.HvProxCsvParser()); +// // Assert.NotNull(parser.NasProxCsvParser()); - // // VBO Tests - // Assert.NotNull(parser.GetDynamicVboGlobal()); - // Assert.NotNull(parser.GetDynamicVboGlobal()); - // Assert.NotNull(parser.GetDynamicVboProxies()); - // Assert.NotNull(parser.GetDynamicVboRbac()); - // Assert.NotNull(parser.GetDynamicVboJobs()); - // Assert.NotNull(parser.GetDynamicVboProcStat()); - // Assert.NotNull(parser.GetDynamicVboRepo()); - // Assert.NotNull(parser.GetDynamicVboSec()); - // Assert.NotNull(parser.GetDynVboController()); - // Assert.NotNull(parser.GetDynVboControllerDriver()); - // Assert.NotNull(parser.GetDynVboJobSess()); - // Assert.NotNull(parser.GetDynVboJobStats()); - // Assert.NotNull(parser.GetDynVboObjRepo()); - // Assert.NotNull(parser.GetDynVboOrg()); - // Assert.NotNull(parser.GetDynVboPerms()); - // Assert.NotNull(parser.GetDynVboProtStat()); - // Assert.NotNull(parser.GetDynVboLicOver()); - // Assert.NotNull(parser.GetDynVboMbProtRep()); - // Assert.NotNull(parser.GetDynVboMbStgConsumption()); - //} - [Fact] - public void FileFinder_Exception_Null() - { - CCsvReader r = new(); - var res = r.FileFinder("", ""); +// // // VBO Tests +// // Assert.NotNull(parser.GetDynamicVboGlobal()); +// // Assert.NotNull(parser.GetDynamicVboGlobal()); +// // Assert.NotNull(parser.GetDynamicVboProxies()); +// // Assert.NotNull(parser.GetDynamicVboRbac()); +// // Assert.NotNull(parser.GetDynamicVboJobs()); +// // Assert.NotNull(parser.GetDynamicVboProcStat()); +// // Assert.NotNull(parser.GetDynamicVboRepo()); +// // Assert.NotNull(parser.GetDynamicVboSec()); +// // Assert.NotNull(parser.GetDynVboController()); +// // Assert.NotNull(parser.GetDynVboControllerDriver()); +// // Assert.NotNull(parser.GetDynVboJobSess()); +// // Assert.NotNull(parser.GetDynVboJobStats()); +// // Assert.NotNull(parser.GetDynVboObjRepo()); +// // Assert.NotNull(parser.GetDynVboOrg()); +// // Assert.NotNull(parser.GetDynVboPerms()); +// // Assert.NotNull(parser.GetDynVboProtStat()); +// // Assert.NotNull(parser.GetDynVboLicOver()); +// // Assert.NotNull(parser.GetDynVboMbProtRep()); +// // Assert.NotNull(parser.GetDynVboMbStgConsumption()); +// //} +// [Fact] +// public void FileFinder_Exception_Null() +// { +// CCsvReader r = new(); +// var res = r.FileFinder("", ""); - Assert.Null(res); - } +// Assert.Null(res); +// } - } -} +// } +//} diff --git a/vHC/VhcXTests/Functions/Reporting/DataTypes/CDataTypesParserTEST.cs b/vHC/VhcXTests/Functions/Reporting/DataTypes/CDataTypesParserTEST.cs index 13e6902..15a88b3 100644 --- a/vHC/VhcXTests/Functions/Reporting/DataTypes/CDataTypesParserTEST.cs +++ b/vHC/VhcXTests/Functions/Reporting/DataTypes/CDataTypesParserTEST.cs @@ -1,71 +1,71 @@ -using CsvHelper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using VeeamHealthCheck.Functions.Reporting.DataTypes; -using VeeamHealthCheck.Functions.Reporting.CsvHandlers; -using VeeamHealthCheck.Functions.Reporting.DataTypes; -using Moq; +//using CsvHelper; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using System.Threading.Tasks; +//using VeeamHealthCheck.Functions.Reporting.DataTypes; +//using VeeamHealthCheck.Functions.Reporting.CsvHandlers; +//using VeeamHealthCheck.Functions.Reporting.DataTypes; +//using Moq; -namespace VhcXTests.Functions.Reporting.DataTypes -{ - public class CDataTypesParserTEST - { - //[Fact] - //public void JobInfo_GetDynamicBjobs_Success() - //{ - // var parser = new CCsvParser(); - // var bjobs = parser.GetDynamicBjobs(); +//namespace VhcXTests.Functions.Reporting.DataTypes +//{ +// public class CDataTypesParserTEST +// { +// //[Fact] +// //public void JobInfo_GetDynamicBjobs_Success() +// //{ +// // var parser = new CCsvParser(); +// // var bjobs = parser.GetDynamicBjobs(); - // Assert.NotNull(bjobs); - //} - [Fact] - public void JobInfo_GetDynamicBjobs_Fail() - { +// // Assert.NotNull(bjobs); +// //} +// [Fact] +// public void JobInfo_GetDynamicBjobs_Fail() +// { - var parser = new CCsvParser(); - IEnumerable bjobs = null; - Assert.Null(bjobs); - } +// var parser = new CCsvParser(); +// IEnumerable bjobs = null; +// Assert.Null(bjobs); +// } - //[Fact] - //public void SobrInfo_Null_Success() - //{ - // CDataTypesParser p = new(); - // var result = p.SobrInfo; +// //[Fact] +// //public void SobrInfo_Null_Success() +// //{ +// // CDataTypesParser p = new(); +// // var result = p.SobrInfo; - // Assert.NotNull(result); - //} - //[Fact] - //public void SobrInfo_Null_Fail() - //{ - // CDataTypesParser p = new(); - // var result = p.SobrInfo; +// // Assert.NotNull(result); +// //} +// //[Fact] +// //public void SobrInfo_Null_Fail() +// //{ +// // CDataTypesParser p = new(); +// // var result = p.SobrInfo; - // Assert.Null(result); - //} - //[Fact] - //public void SobrInfo_List_Success() - //{ - // var parser = new Mock(); - // parser.Setup(x => x.SobrInfo).Returns(new List()); +// // Assert.Null(result); +// //} +// //[Fact] +// //public void SobrInfo_List_Success() +// //{ +// // var parser = new Mock(); +// // parser.Setup(x => x.SobrInfo).Returns(new List()); - // Assert.NotNull(parser); - //} - [Fact] - public void SobrInfo_EmptyList_Fail() - { +// // Assert.NotNull(parser); +// //} +// [Fact] +// public void SobrInfo_EmptyList_Fail() +// { - } +// } - [Fact] - public void SobrCsvResults_ReturnList_Success() - { - var parser = new Mock(); +// [Fact] +// public void SobrCsvResults_ReturnList_Success() +// { +// var parser = new Mock(); - } - } -} +// } +// } +//} diff --git a/vHC/VhcXTests/Functions/Reporting/Html/CHtmlExporterTEST.cs b/vHC/VhcXTests/Functions/Reporting/Html/CHtmlExporterTEST.cs index 44216c3..6896ce3 100644 --- a/vHC/VhcXTests/Functions/Reporting/Html/CHtmlExporterTEST.cs +++ b/vHC/VhcXTests/Functions/Reporting/Html/CHtmlExporterTEST.cs @@ -1,66 +1,66 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using VeeamHealthCheck.Functions.Reporting.Html; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using System.Threading.Tasks; +//using VeeamHealthCheck.Functions.Reporting.Html; -namespace VhcXTests.Functions.Reporting.Html -{ - public class CHtmlExporterTEST - { - [Fact] - public void ExportVb365_Result_Positive() - { - Thread.Sleep(10); - CHtmlExporter e = new("TestSystem"); - int res = e.ExportVb365Html("testHTML"); +//namespace VhcXTests.Functions.Reporting.Html +//{ +// public class CHtmlExporterTEST +// { +// [Fact] +// public void ExportVb365_Result_Positive() +// { +// Thread.Sleep(10); +// CHtmlExporter e = new("TestSystem"); +// int res = e.ExportVb365Html("testHTML"); - Assert.Equal(0, res); +// Assert.Equal(0, res); - } - [Fact] - public void ExportVbr_Scrub_Positive() - { - Thread.Sleep(200); - CHtmlExporter e = new("TestSystem"); - var res = e.ExportVbrHtml("fakeString", true); +// } +// [Fact] +// public void ExportVbr_Scrub_Positive() +// { +// Thread.Sleep(200); +// CHtmlExporter e = new("TestSystem"); +// var res = e.ExportVbrHtml("fakeString", true); - Assert.Equal(0, res); - } - [Fact] - public void ExportVbr_NoScrub_Positive() - { - Thread.Sleep(300); - CHtmlExporter e = new("TestSystem"); - var res = e.ExportVbrHtml("fakeString", false); +// Assert.Equal(0, res); +// } +// [Fact] +// public void ExportVbr_NoScrub_Positive() +// { +// Thread.Sleep(300); +// CHtmlExporter e = new("TestSystem"); +// var res = e.ExportVbrHtml("fakeString", false); - Assert.Equal(0, res); - } - //[Fact] - //public void ExportSecurity_Scrub_Positive() - //{ - // CHtmlExporter e = new("TestSystem"); - // var res = e.ExportVbrSecurityHtml("fakeString", true); +// Assert.Equal(0, res); +// } +// //[Fact] +// //public void ExportSecurity_Scrub_Positive() +// //{ +// // CHtmlExporter e = new("TestSystem"); +// // var res = e.ExportVbrSecurityHtml("fakeString", true); - // Assert.Equal(0, res); - //} +// // Assert.Equal(0, res); +// //} - //[Fact] - //public void OpenExplorerIfEnabled_True_Success() - //{ - // CHtmlExporter e = new("TestServer"); - // var res = e.OpenHtmlIfEnabled(true); +// //[Fact] +// //public void OpenExplorerIfEnabled_True_Success() +// //{ +// // CHtmlExporter e = new("TestServer"); +// // var res = e.OpenHtmlIfEnabled(true); - // Assert.Equal(0, res); - //} - [Fact] - public void OpenExplorerIfEnabled_False_Success() - { - CHtmlExporter e = new("TestServer"); - var res = e.OpenHtmlIfEnabled(false); +// // Assert.Equal(0, res); +// //} +// [Fact] +// public void OpenExplorerIfEnabled_False_Success() +// { +// CHtmlExporter e = new("TestServer"); +// var res = e.OpenHtmlIfEnabled(false); - Assert.Equal(1, res); - } - } -} +// Assert.Equal(1, res); +// } +// } +//} diff --git a/vHC/VhcXTests/Functions/Reporting/Html/Shared/CObjectHelpersTEST.cs b/vHC/VhcXTests/Functions/Reporting/Html/Shared/CObjectHelpersTEST.cs index 8d8d70f..b183dc1 100644 --- a/vHC/VhcXTests/Functions/Reporting/Html/Shared/CObjectHelpersTEST.cs +++ b/vHC/VhcXTests/Functions/Reporting/Html/Shared/CObjectHelpersTEST.cs @@ -1,61 +1,61 @@ -using Moq; -using VeeamHealthCheck.Functions.Reporting.Html.Shared; -using VeeamHealthCheck.Functions.Reporting.CsvHandlers; -using VeeamHealthCheck.Functions.Collection.DB; - -namespace VhcXTests.Functions.Reporting.Html.Shared -{ - public class CObjectHelpersTEST - { - [Fact] - public void ParseBool_ValidString_True() - { - var result = CObjectHelpers.ParseBool("true"); - - Assert.True(result); - - } - [Fact] - public void ParseBool_NotValidString_True() - { - var result = CObjectHelpers.ParseBool("truse"); - - Assert.False(result); - - } - [Fact] - public void CBJobCsv_String_Success() - { - //var result = Mock(); - CBjobCsv c = new(); - - c.JobType = "test"; - c.Name = "testName"; - c.RepositoryId = "id"; - c.actualSize = "42"; - - Assert.Equal("test", c.JobType); - Assert.Equal("testName", c.Name); - Assert.Equal("id", c.RepositoryId); - Assert.Equal("42", c.actualSize); - } - - [Fact] - public void CRegReader_DbString_Null() - { - var reader = new CRegReader(); - var result = reader.DbString; - - Assert.Equal(null, result); - } - [Fact] - public void CRegReader_HostString_Null() - { - var reader = new CRegReader(); - var result = reader.HostString; - - Assert.Equal(null, result); - } - - } -} +//using Moq; +//using VeeamHealthCheck.Functions.Reporting.Html.Shared; +//using VeeamHealthCheck.Functions.Reporting.CsvHandlers; +//using VeeamHealthCheck.Functions.Collection.DB; + +//namespace VhcXTests.Functions.Reporting.Html.Shared +//{ +// public class CObjectHelpersTEST +// { +// [Fact] +// public void ParseBool_ValidString_True() +// { +// var result = CObjectHelpers.ParseBool("true"); + +// Assert.True(result); + +// } +// [Fact] +// public void ParseBool_NotValidString_True() +// { +// var result = CObjectHelpers.ParseBool("truse"); + +// Assert.False(result); + +// } +// [Fact] +// public void CBJobCsv_String_Success() +// { +// //var result = Mock(); +// CBjobCsv c = new(); + +// c.JobType = "test"; +// c.Name = "testName"; +// c.RepositoryId = "id"; +// c.actualSize = "42"; + +// Assert.Equal("test", c.JobType); +// Assert.Equal("testName", c.Name); +// Assert.Equal("id", c.RepositoryId); +// Assert.Equal("42", c.actualSize); +// } + +// [Fact] +// public void CRegReader_DbString_Null() +// { +// var reader = new CRegReader(); +// var result = reader.DbString; + +// Assert.Equal(null, result); +// } +// [Fact] +// public void CRegReader_HostString_Null() +// { +// var reader = new CRegReader(); +// var result = reader.HostString; + +// Assert.Equal(null, result); +// } + +// } +//} diff --git a/vHC/VhcXTests/Functions/Reporting/Html/VBR/VbrTables/CJobSessSummaryTEST.cs b/vHC/VhcXTests/Functions/Reporting/Html/VBR/VbrTables/CJobSessSummaryTEST.cs index b1fbd6d..71351cd 100644 --- a/vHC/VhcXTests/Functions/Reporting/Html/VBR/VbrTables/CJobSessSummaryTEST.cs +++ b/vHC/VhcXTests/Functions/Reporting/Html/VBR/VbrTables/CJobSessSummaryTEST.cs @@ -1,431 +1,431 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Management.Automation.Language; -using System.Text; -using System.Threading.Tasks; -using VeeamHealthCheck; -using VeeamHealthCheck.Functions.Reporting.CsvHandlers; -using VeeamHealthCheck.Functions.Reporting.CsvHandlers.VB365; -using VeeamHealthCheck.Functions.Reporting.Html; - -namespace VhcXTests.Functions.Reporting.Html.VBR.VbrTables -{ - public class CJobSessSummaryTEST - { - private string _originalPath = CVariables._vbrDir; - [Fact] - public void CDataFormer_JobSessionSummary_Success() - { - CDataFormer df = new(); - var result = df.ConvertJobSessSummaryToXml(false); - - Assert.NotNull(result); - } - [Fact] - public void CDataFormer_IndividualSessions_Scrub_Success() - { - CDataFormer df = new(); - var res = df.JobSessionInfoToXml(true); - Assert.Equal(0, res); - } - [Fact] - public void CDataFormer_IndividualSessions_NoScrub_Success() - { - CDataFormer df = new(); - var res = df.JobSessionInfoToXml(false); - Assert.Equal(0, res); - } - [Fact] - public void CDataFormer_IndividualSessions_NoScrub_NoFile_Success() - { - CCsvParser parser = new(); - string originalPath = parser._sessionPath; - parser._sessionPath = "/Fart"; - CDataFormer df = new(); - var res = df.JobSessionInfoToXml(false); - Assert.Equal(0, res); - - parser._sessionPath = originalPath; - } - //[Fact] - //public void CDataFormer_ParserNonProtectedTypes_Default() - //{ - // CDataFormer df = new(); - // var res = df.ParseNonProtectedTypes(); - - // Assert.NotNull(res); - //} - [Fact] - public void CDataFormer_SecSummary_Default() - { - CDataFormer df = new(); - var res = df.SecSummary(); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_ServerSummaryToXml_Default() - { - CDataFormer df = new(); - var res = df.ServerSummaryToXml(); - - Assert.NotNull(res); - } - //[Fact] - //public void CDataFormer_ProtectedWorkloadsToXml_FilePresent_Default() - //{ - // CDataFormer df = new(); - // var res = df.ProtectedWorkloadsToXml(); - - // Assert.Equal(0, res); - //} - [Fact] - public void CDataFormer_ProtectedWorkloadsToXml_NoFilePresent_Fail() - { - string originalDir = CVariables.vbrDir; - CVariables._vbrDir = @"C:\temp\vHC\nothingness"; - - CDataFormer df = new(); - var res = df.ProtectedWorkloadsToXml(); - - Assert.Equal(1, res); - CVariables._vbrDir = originalDir; - } - //[Fact] - //public void CDataFormer_BackupServerInfoToXml_Scrub_File_Default() - //{ - // CDataFormer df = new(); - // var res = df.BackupServerInfoToXml(true); - - // Assert.NotNull(res); - //} - //[Fact] - //public void CDataFormer_BackupServerInfoToXml_NoScrub_File_Default() - //{ - // CDataFormer df = new(); - // var res = df.BackupServerInfoToXml(false); - - // Assert.NotNull(res); - //} - [Fact] - public void CDataFormer_BackupServerInfoToXml_Scrub_NoFile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.BackupServerInfoToXml(true); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - [Fact] - public void CDataFormer_BackupServerInfoToXml_NoScrub_NoFile_Default() - { - CDataFormer df = new(); - var res = df.BackupServerInfoToXml(false); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_SobrInfoToXml_NoScrub_Default() - { - CDataFormer df = new(); - var res = df.SobrInfoToXml(false); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_SobrInfoToXml_Scrub_Default() - { - CDataFormer df = new(); - var res = df.SobrInfoToXml(true); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_SobrInfoToXml_NoScrub_NoFile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.SobrInfoToXml(false); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - [Fact] - public void CDataFormer_SobrInfoToXml_Scrub_NoFile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.SobrInfoToXml(true); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - [Fact] - public void CDataFormer_ExtentXmlFromCsv_Scrub_Default() - { - CDataFormer df = new(); - var res = df.ExtentXmlFromCsv(true); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_ExtentXmlFromCsv_NoScrubDefault() - { - CDataFormer df = new(); - var res = df.ExtentXmlFromCsv(false); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_ExtentXmlFromCsv_Scrub_Nofile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.ExtentXmlFromCsv(true); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - [Fact] - public void CDataFormer_ExtentXmlFromCsv_NoScrub_Nofile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.ExtentXmlFromCsv(false); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - [Fact] - public void CDataFormer_RepoInfoToXml_Scrub_Default() - { - CDataFormer df = new(); - var res = df.RepoInfoToXml(true); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_RepoInfoToXml_NoScrubDefault() - { - CDataFormer df = new(); - var res = df.RepoInfoToXml(false); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_RepoInfoToXml_Scrub_Nofile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.RepoInfoToXml(true); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - [Fact] - public void CDataFormer_RepoInfoToXml_NoScrub_Nofile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.RepoInfoToXml(false); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - - [Fact] - public void CDataFormer_ProxyXmlFromCsv_Scrub_Default() - { - CDataFormer df = new(); - var res = df.ProxyXmlFromCsv(true); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_ProxyXmlFromCsv_NoScrubDefault() - { - CDataFormer df = new(); - var res = df.ProxyXmlFromCsv(false); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_ProxyXmlFromCsv_Scrub_Nofile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.ProxyXmlFromCsv(true); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - [Fact] - public void CDataFormer_ProxyXmlFromCsv_NoScrub_Nofile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.ProxyXmlFromCsv(false); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - [Fact] - public void CDataFormer_ServerXmlFromCsv_Scrub_Default() - { - CDataFormer df = new(); - var res = df.ServerXmlFromCsv(true); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_ServerXmlFromCsv_NoScrubDefault() - { - CDataFormer df = new(); - var res = df.ServerXmlFromCsv(false); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_ServerXmlFromCsv_Scrub_Nofile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.ServerXmlFromCsv(true); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - [Fact] - public void CDataFormer_ServerXmlFromCsv_NoScrub_Nofile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.ServerXmlFromCsv(false); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - [Fact] - public void CDataFormer_JobSummaryInfoToXml_Nofile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.JobSummaryInfoToXml(); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - [Fact] - public void CDataFormer_JobSummaryInfoToXml_Default() - { - CDataFormer df = new(); - var res = df.JobSummaryInfoToXml(); - - Assert.NotNull(res); - } - - //[Fact] - //public void CDataFormer_JobConcurrency_Default() - //{ - // CDataFormer df = new(); - // var res = df.JobConcurrency(true); - - // Assert.NotNull(res); - //} - [Fact] - public void CDataFormer_JobConcurrency_False_Default() - { - CDataFormer df = new(); - var res = df.JobConcurrency(false); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_JobConcurrency_nofile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.JobConcurrency(true); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - [Fact] - public void CDataFormer_JobConcurrency_False_nofile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.JobConcurrency(false); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - - [Fact] - public void CDataFormer_RegOptions_False_Default() - { - CDataFormer df = new(); - var res = df.RegOptions(); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_RegOptions_nofile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.RegOptions(); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - - [Fact] - public void CDataFormer_JobInfoToXml_Default() - { - CDataFormer df = new(); - var res = df.JobInfoToXml(true); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_JobInfoToXml_False_Default() - { - CDataFormer df = new(); - var res = df.JobInfoToXml(false); - - Assert.NotNull(res); - } - [Fact] - public void CDataFormer_JobInfoToXml_nofile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.JobInfoToXml(true); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - [Fact] - public void CDataFormer_JobInfoToXml_False_nofile_Default() - { - SetFalsePath(); - CDataFormer df = new(); - var res = df.JobInfoToXml(false); - - Assert.NotNull(res); - SetPathBackToNormal(); - } - - private void SetFalsePath() - { - CVariables._vbrDir = @"C:\temp\vHC\doesntexist"; - } - private void SetPathBackToNormal() - { - CVariables._vbrDir = _originalPath; - } - } -} +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Management.Automation.Language; +//using System.Text; +//using System.Threading.Tasks; +//using VeeamHealthCheck; +//using VeeamHealthCheck.Functions.Reporting.CsvHandlers; +//using VeeamHealthCheck.Functions.Reporting.CsvHandlers.VB365; +//using VeeamHealthCheck.Functions.Reporting.Html; + +//namespace VhcXTests.Functions.Reporting.Html.VBR.VbrTables +//{ +// public class CJobSessSummaryTEST +// { +// private string _originalPath = CVariables._vbrDir; +// [Fact] +// public void CDataFormer_JobSessionSummary_Success() +// { +// CDataFormer df = new(); +// var result = df.ConvertJobSessSummaryToXml(false); + +// Assert.NotNull(result); +// } +// [Fact] +// public void CDataFormer_IndividualSessions_Scrub_Success() +// { +// CDataFormer df = new(); +// var res = df.JobSessionInfoToXml(true); +// Assert.Equal(0, res); +// } +// [Fact] +// public void CDataFormer_IndividualSessions_NoScrub_Success() +// { +// CDataFormer df = new(); +// var res = df.JobSessionInfoToXml(false); +// Assert.Equal(0, res); +// } +// [Fact] +// public void CDataFormer_IndividualSessions_NoScrub_NoFile_Success() +// { +// CCsvParser parser = new(); +// string originalPath = parser._sessionPath; +// parser._sessionPath = "/Fart"; +// CDataFormer df = new(); +// var res = df.JobSessionInfoToXml(false); +// Assert.Equal(0, res); + +// parser._sessionPath = originalPath; +// } +// //[Fact] +// //public void CDataFormer_ParserNonProtectedTypes_Default() +// //{ +// // CDataFormer df = new(); +// // var res = df.ParseNonProtectedTypes(); + +// // Assert.NotNull(res); +// //} +// [Fact] +// public void CDataFormer_SecSummary_Default() +// { +// CDataFormer df = new(); +// var res = df.SecSummary(); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_ServerSummaryToXml_Default() +// { +// CDataFormer df = new(); +// var res = df.ServerSummaryToXml(); + +// Assert.NotNull(res); +// } +// //[Fact] +// //public void CDataFormer_ProtectedWorkloadsToXml_FilePresent_Default() +// //{ +// // CDataFormer df = new(); +// // var res = df.ProtectedWorkloadsToXml(); + +// // Assert.Equal(0, res); +// //} +// [Fact] +// public void CDataFormer_ProtectedWorkloadsToXml_NoFilePresent_Fail() +// { +// string originalDir = CVariables.vbrDir; +// CVariables._vbrDir = @"C:\temp\vHC\nothingness"; + +// CDataFormer df = new(); +// var res = df.ProtectedWorkloadsToXml(); + +// Assert.Equal(1, res); +// CVariables._vbrDir = originalDir; +// } +// //[Fact] +// //public void CDataFormer_BackupServerInfoToXml_Scrub_File_Default() +// //{ +// // CDataFormer df = new(); +// // var res = df.BackupServerInfoToXml(true); + +// // Assert.NotNull(res); +// //} +// //[Fact] +// //public void CDataFormer_BackupServerInfoToXml_NoScrub_File_Default() +// //{ +// // CDataFormer df = new(); +// // var res = df.BackupServerInfoToXml(false); + +// // Assert.NotNull(res); +// //} +// [Fact] +// public void CDataFormer_BackupServerInfoToXml_Scrub_NoFile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.BackupServerInfoToXml(true); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } +// [Fact] +// public void CDataFormer_BackupServerInfoToXml_NoScrub_NoFile_Default() +// { +// CDataFormer df = new(); +// var res = df.BackupServerInfoToXml(false); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_SobrInfoToXml_NoScrub_Default() +// { +// CDataFormer df = new(); +// var res = df.SobrInfoToXml(false); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_SobrInfoToXml_Scrub_Default() +// { +// CDataFormer df = new(); +// var res = df.SobrInfoToXml(true); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_SobrInfoToXml_NoScrub_NoFile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.SobrInfoToXml(false); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } +// [Fact] +// public void CDataFormer_SobrInfoToXml_Scrub_NoFile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.SobrInfoToXml(true); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } +// [Fact] +// public void CDataFormer_ExtentXmlFromCsv_Scrub_Default() +// { +// CDataFormer df = new(); +// var res = df.ExtentXmlFromCsv(true); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_ExtentXmlFromCsv_NoScrubDefault() +// { +// CDataFormer df = new(); +// var res = df.ExtentXmlFromCsv(false); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_ExtentXmlFromCsv_Scrub_Nofile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.ExtentXmlFromCsv(true); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } +// [Fact] +// public void CDataFormer_ExtentXmlFromCsv_NoScrub_Nofile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.ExtentXmlFromCsv(false); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } +// [Fact] +// public void CDataFormer_RepoInfoToXml_Scrub_Default() +// { +// CDataFormer df = new(); +// var res = df.RepoInfoToXml(true); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_RepoInfoToXml_NoScrubDefault() +// { +// CDataFormer df = new(); +// var res = df.RepoInfoToXml(false); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_RepoInfoToXml_Scrub_Nofile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.RepoInfoToXml(true); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } +// [Fact] +// public void CDataFormer_RepoInfoToXml_NoScrub_Nofile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.RepoInfoToXml(false); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } + +// [Fact] +// public void CDataFormer_ProxyXmlFromCsv_Scrub_Default() +// { +// CDataFormer df = new(); +// var res = df.ProxyXmlFromCsv(true); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_ProxyXmlFromCsv_NoScrubDefault() +// { +// CDataFormer df = new(); +// var res = df.ProxyXmlFromCsv(false); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_ProxyXmlFromCsv_Scrub_Nofile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.ProxyXmlFromCsv(true); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } +// [Fact] +// public void CDataFormer_ProxyXmlFromCsv_NoScrub_Nofile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.ProxyXmlFromCsv(false); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } +// [Fact] +// public void CDataFormer_ServerXmlFromCsv_Scrub_Default() +// { +// CDataFormer df = new(); +// var res = df.ServerXmlFromCsv(true); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_ServerXmlFromCsv_NoScrubDefault() +// { +// CDataFormer df = new(); +// var res = df.ServerXmlFromCsv(false); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_ServerXmlFromCsv_Scrub_Nofile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.ServerXmlFromCsv(true); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } +// [Fact] +// public void CDataFormer_ServerXmlFromCsv_NoScrub_Nofile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.ServerXmlFromCsv(false); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } +// [Fact] +// public void CDataFormer_JobSummaryInfoToXml_Nofile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.JobSummaryInfoToXml(); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } +// [Fact] +// public void CDataFormer_JobSummaryInfoToXml_Default() +// { +// CDataFormer df = new(); +// var res = df.JobSummaryInfoToXml(); + +// Assert.NotNull(res); +// } + +// //[Fact] +// //public void CDataFormer_JobConcurrency_Default() +// //{ +// // CDataFormer df = new(); +// // var res = df.JobConcurrency(true); + +// // Assert.NotNull(res); +// //} +// [Fact] +// public void CDataFormer_JobConcurrency_False_Default() +// { +// CDataFormer df = new(); +// var res = df.JobConcurrency(false); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_JobConcurrency_nofile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.JobConcurrency(true); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } +// [Fact] +// public void CDataFormer_JobConcurrency_False_nofile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.JobConcurrency(false); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } + +// [Fact] +// public void CDataFormer_RegOptions_False_Default() +// { +// CDataFormer df = new(); +// var res = df.RegOptions(); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_RegOptions_nofile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.RegOptions(); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } + +// [Fact] +// public void CDataFormer_JobInfoToXml_Default() +// { +// CDataFormer df = new(); +// var res = df.JobInfoToXml(true); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_JobInfoToXml_False_Default() +// { +// CDataFormer df = new(); +// var res = df.JobInfoToXml(false); + +// Assert.NotNull(res); +// } +// [Fact] +// public void CDataFormer_JobInfoToXml_nofile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.JobInfoToXml(true); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } +// [Fact] +// public void CDataFormer_JobInfoToXml_False_nofile_Default() +// { +// SetFalsePath(); +// CDataFormer df = new(); +// var res = df.JobInfoToXml(false); + +// Assert.NotNull(res); +// SetPathBackToNormal(); +// } + +// private void SetFalsePath() +// { +// CVariables._vbrDir = @"C:\temp\vHC\doesntexist"; +// } +// private void SetPathBackToNormal() +// { +// CVariables._vbrDir = _originalPath; +// } +// } +//} diff --git a/vHC/VhcXTests/UnitTest1.cs b/vHC/VhcXTests/UnitTest1.cs index 8480a18..c0ad316 100644 --- a/vHC/VhcXTests/UnitTest1.cs +++ b/vHC/VhcXTests/UnitTest1.cs @@ -1,11 +1,11 @@ -namespace VhcXTests -{ - public class UnitTest1 - { - [Fact] - public void Test1() - { - Assert.True(true); - } - } -} \ No newline at end of file +//namespace VhcXTests +//{ +// public class UnitTest1 +// { +// [Fact] +// public void Test1() +// { +// Assert.True(true); +// } +// } +//} \ No newline at end of file diff --git a/vHC/VhcXTests/VhcXTests.csproj b/vHC/VhcXTests/VhcXTests.csproj index a809c28..163a0a9 100644 --- a/vHC/VhcXTests/VhcXTests.csproj +++ b/vHC/VhcXTests/VhcXTests.csproj @@ -1,25 +1,21 @@ - net7.0-windows + net8.0-windows7.0 enable enable false true - 1.0.0.230 - 1.0.0.230 + 1.0.0.244 + 1.0.0.244 - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all