How to include Test Project in Analyz

I use Gitlab CI for automation and .Net Framework for main project, .Net Core for test project.Why sonar does not analyze cs files.Why or how I can include test project because sonar does’t make analyze for him and I can get code coverege.

    variables:
  SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"  # Defines the location of the analysis task cache
  GIT_DEPTH: "0"  # Tells git to fetch all the branches of the project, required by the analysis task

stages:
  - build
  - test
  - analyze

before_script:
 - Set-Variable -Name "time" -Value (Get-Date -Format "%H:%m")
 - echo ${time}
 - echo "started by ${GITLAB_USER_NAME}"



build:
  stage: build
  only:
    - branches
  script:
    - echo "running scripts in the build job"
    - choco feature enable -n=allowGlobalConfirmation
    - choco install netfx-4.6.2-devpack
    - choco install dotnetcore-sdk
    - nuget restore -ConfigFile .\nuget.config 
    - msbuild ".\ProcessFlowModuleDotNetV1\ProcessFlowModule.csproj" /p:DeployOnBuild=true /p:PublishProfile="Local Publish" /p:WarningLevel=0
    - dotnet build ".\ProcessFlowModuleDotNetV1.Tests\ProcessFlowModule.Tests.csproj" --configuration Release
  artifacts:
    paths:
      - Publish
      - .\ProcessFlowModule.Tests\bin\Release\netcoreapp3.1\**
      - .\ProcessFlowModule
    expire_in: 1 day
  after_script:
    - Remove-Item -Recurse -Force .\packages\


sonarcloud-check:
  image:
    name: sonarsource/sonar-scanner-cli:latest
    entrypoint: [""]
  cache:
    key: "${CI_JOB_NAME}"
    paths:
      - .sonar/cache
  dependencies:
    - build
  script:    
    - SonarScanner.MSBuild.exe begin /k:"project_key" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="jjhyd8b6500d75a8af6f7c3a3726a2b8782a39a439a7"   
    - nuget restore -ConfigFile .\nuget.config
    - MsBuild.exe ./ProcessFlowModule /t:Rebuild
    - SonarScanner.MSBuild.exe end /d:sonar.login="jjhyd8b6500d75a8af6f7c3a3726a2b8782a39a439a7"
  only:
    - branches

Here I try with default script:
    sonarcloud-check:
  stage: test
  image:
    name: sonarsource/sonar-scanner-cli:latest
    entrypoint: [""]
  cache:
    key: "${CI_JOB_NAME}"
    paths:
      - .sonar/cache
  script:
    - sonar-scanner

This wiki page describes how the Scanner for .NET handles test projects and explains how to tell the scanner to analyse a test project as if it were a “product” project.