diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..94286c9
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) .NET Foundation and Contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/NuGet.Config b/NuGet.Config
new file mode 100644
index 0000000..ef0bacf
--- /dev/null
+++ b/NuGet.Config
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
index 4474548..9a68790 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,80 @@
-# nanoFramework.TestPlatform
nanoFramework Unit Test platform
+[](LICENSE) [](https://www.nuget.org/packages/nanoframework.TestFramework/) [](https://github.com/nanoframework/Home/blob/master/CONTRIBUTING.md) [](https://discord.gg/gCyBu8T)
+
+
+
+-----
+
+# Welcome to the **nanoFramework** Unit Test Framework repository!
+
+## Build status
+
+| Component | Build Status | NuGet Package |
+|:-|---|---|
+| nanoframework.TestFramework | [](https://dev.azure.com/nanoframework/nanoframework.TestFramework/_build/latest?definitionId=67&repoName=nanoframework%2FnanoFramework.TestFramework&branchName=master) | [](https://www.nuget.org/packages/nanoframework.TestFramework/) |
+| nanoframework.TestFramework (preview) | [](https://dev.azure.com/nanoframework/nanoframework.TestFramework/_build/latest?definitionId=67&repoName=nanoframework%2FnanoFramework.TestFramework&branchName=develop) | [](https://dev.azure.com/nanoframework/feed/_packaging?_a=package&feed=sandbox&package=nanoframework.TestFramework&protocolType=NuGet&view=overview) |
+
+## What is the .NET nanoFramework Test Framework
+
+nanoFramework TestFramework it's a Unit Test framework dedicated to .NET nanoFramework! It has all the benefits of what you're used to when using Microsoft Test platform for .NET or XUnit or any other!
+
+The framework includes multiple elements that are distributed in a single NuGet package!
+
+- `nanoFramework.TestFramework` which contains the attributes to decorate your code and the `Assert` classes to check that you're code is properly doing what's expected.
+- `nanoFramework.UnitTestLauncher` which is the engine launching and managing the Unit Tests.
+- `nanoFramework.TestAdapter` which is the Visual Studio Test platform adapter, allowing to have the test integration in Visual Studio.
+
+The integration looks like that:
+
+
+
+And the integration will point you up to your code for successful or failed tests:
+
+
+
+## Usage of .NET nanoFramework Test Framework
+
+Simply add the `nanoFramework.TestFramework` nuget to your project and you're good to go!
+
+
+
+Once you'll build your project, the tests will be automatically discovered:
+
+
+
+You can then run all the tests and you'll get the result:
+
+
+
+To have more details on usage of the framework, please refer to the detailed [documentation here](https://docs.nanoframework.net/).
+
+## What you'll find in this repository
+
+This repository contains the source of the core elements. You'll find them in `sources` directory. The Visual Studio projects in the root directory will open those elements.
+
+## Sample pack
+
+You can find on our samples repo a [sample pack](https://github.com/nanoframework/Samples/tree/master/samples/UnitTest) with projects demoing how to use the Unit Test Framework.
+
+## Feedback and documentation
+
+For documentation, providing feedback, issues and finding out how to contribute please refer to the [Home repo](https://github.com/nanoframework/Home).
+
+Join our Discord community [here](https://discord.gg/gCyBu8T).
+
+## Credits
+
+The list of contributors to this project can be found at [CONTRIBUTORS](https://github.com/nanoframework/Home/blob/master/CONTRIBUTORS.md).
+
+## License
+
+The .NET **nanoFramework** Test Framework is licensed under the [MIT license](LICENSE.md).
+
+## Code of Conduct
+
+This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
+For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
+
+### .NET Foundation
+
+This project is supported by the [.NET Foundation](https://dotnetfoundation.org).
\ No newline at end of file
diff --git a/assets/nf-logo.png b/assets/nf-logo.png
new file mode 100644
index 0000000..6f576ca
Binary files /dev/null and b/assets/nf-logo.png differ
diff --git a/assets/test-discovered.jpg b/assets/test-discovered.jpg
new file mode 100644
index 0000000..8671cc7
Binary files /dev/null and b/assets/test-discovered.jpg differ
diff --git a/assets/test-integration-vs-failed.jpg b/assets/test-integration-vs-failed.jpg
new file mode 100644
index 0000000..5d26d97
Binary files /dev/null and b/assets/test-integration-vs-failed.jpg differ
diff --git a/assets/test-integration-vs.jpg b/assets/test-integration-vs.jpg
new file mode 100644
index 0000000..2104fb8
Binary files /dev/null and b/assets/test-integration-vs.jpg differ
diff --git a/assets/test-nuget-test-framework.jpg b/assets/test-nuget-test-framework.jpg
new file mode 100644
index 0000000..ce66c48
Binary files /dev/null and b/assets/test-nuget-test-framework.jpg differ
diff --git a/assets/test-success.jpg b/assets/test-success.jpg
new file mode 100644
index 0000000..40c9e85
Binary files /dev/null and b/assets/test-success.jpg differ
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
new file mode 100644
index 0000000..1decf66
--- /dev/null
+++ b/azure-pipelines.yml
@@ -0,0 +1,321 @@
+trigger:
+ branches:
+ include: [master, develop, "release-*" ]
+ paths:
+ exclude: ["*.md", .gitignore]
+ tags:
+ include: ["v*"]
+
+# PR always trigger build
+
+# add nf-tools repo to resources (for Azure Pipelines templates)
+resources:
+ repositories:
+ - repository: templates
+ type: github
+ name: nanoframework/nf-tools
+ endpoint: nanoframework
+
+jobs:
+
+##############################
+- job: Get_Build_Flags
+ pool:
+ vmImage: 'windows-2019'
+
+ steps:
+ - checkout: self
+ fetchDepth: 1
+
+ # get commit message
+ - powershell: |
+
+ # default to false
+ $update = $false
+
+ if($env:Build_Reason -eq 'PullRequest')
+ {
+ # PR build, nothing interesting in commit message
+ }
+ else
+ {
+ # build is not from a PR
+
+ # get commit ID
+ $commitId = git rev-parse HEAD
+
+ # get PR associate with commit
+ $prUrl = "https://api.github.com/repos/nanoframework/nanoFramework.TestFramework/commits/$commitId/pulls"
+ $commit = Invoke-RestMethod -Uri $prUrl -ContentType "application/json" -Headers @{"Accept"="application/vnd.github.groot-preview+json"} -Method GET
+
+ if($commit -ne $null)
+ {
+ # there is a PR, check labels
+ $updateDependents = $commit.labels | where {$_.Name -eq 'CI: Update Dependents'}
+ if($updateDependents -ne $null)
+ {
+ $update = $true
+ }
+ }
+ }
+
+ # set variable to foward to jobs
+ echo "##vso[task.setvariable variable=RUN_UPDATE_DEPENDENTS;isOutput=true]$update"
+ name: GetPRLabels
+ displayName: Check build labels
+
+#########################################################
+# build
+- job: Build_Test_Framework
+ condition: eq(variables['UPDATE_DEPENDENTS'], 'false')
+
+ dependsOn:
+ - Get_Build_Flags
+
+ pool:
+ vmImage: 'windows-2019'
+
+ variables:
+ DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
+ buildPlatform: 'Any CPU'
+ buildConfiguration: 'Debug'
+
+ steps:
+
+ # need this here in order to persist GitHub credentials, do a shallow fetch AND init submodules
+ - checkout: self
+ persistCredentials: true
+
+ - script: |
+ git config --global user.email "nanoframework@outlook.com"
+ git config --global user.name "nfbot"
+ displayName: Setup git identity
+
+ - task: NuGetToolInstaller@1
+ condition: not(variables['StartReleaseCandidate'])
+ displayName: 'Install specific version of NuGet'
+ inputs:
+ versionSpec: '5.8.0'
+
+ - task: DotNetCoreCLI@2
+ condition: ne(variables['system.pullrequest.isfork'], true)
+ displayName: Install NBGV tool
+ inputs:
+ command: custom
+ custom: tool
+ arguments: install -g nbgv
+
+ - task: InstallnFBuildComponents@1
+ condition: ne( variables['StartReleaseCandidate'], true )
+ displayName: Install nanoFramework MSBuild components
+
+ - task: NuGetCommand@2
+ displayName: NuGet restore Test Adapter
+ inputs:
+ restoreSolution: 'nanoFramework.TestAdapter.sln'
+ feedsToUse: config
+ nugetConfigPath: 'NuGet.config'
+
+ - task: NuGetCommand@2
+ displayName: NuGet restore Test Framework
+ inputs:
+ restoreSolution: 'nanoFramework.TestFramework.sln'
+ feedsToUse: config
+ nugetConfigPath: 'NuGet.config'
+
+ - task: VSBuild@1
+ displayName: Build Test Adapter
+ inputs:
+ solution: 'nanoFramework.TestAdapter.sln'
+ platform: '$(buildPlatform)'
+ msbuildArgs: '/p:PublicRelease=true'
+ configuration: '$(buildConfiguration)'
+
+ - task: VSBuild@1
+ displayName: Build Test Framework
+ inputs:
+ solution: 'nanoFramework.TestFramework.sln'
+ platform: '$(buildPlatform)'
+ msbuildArgs: '/p:PublicRelease=true'
+ configuration: '$(buildConfiguration)'
+
+ # - task: VisualStudioTestPlatformInstaller@1
+ # condition: succeeded()
+ # displayName: 'Visual Studio Test Platform Installer'
+ # inputs:
+ # versionSelector: latestStable
+
+ # - task: VSTest@2
+ # condition: succeeded()
+ # displayName: 'Running tests'
+ # inputs:
+ # testSelector: 'testAssemblies'
+ # testAssemblyVer2: |
+ # **\*Tests*.dll
+ # !**\*TestAdapter*.dll
+ # !**\*TestFramework*.dll
+ # !**\obj\**
+ # searchFolder: '$(System.DefaultWorkingDirectory)'
+ # platform: '$(BuildPlatform)'
+ # configuration: '$(BuildConfiguration)'
+ # diagnosticsEnabled: true
+ # vsTestVersion: toolsInstaller
+ # codeCoverageEnabled: true
+
+ # update could build number (only possible if this is not a PR from a fork)
+ - task: PowerShell@2
+ condition: and( succeeded(), ne(variables['system.pullrequest.isfork'], true) )
+ displayName: Update cloud build number
+ inputs:
+ targetType: 'inline'
+ script: Write-Host "$("##vso[build.updatebuildnumber]")$env:NBGV_NuGetPackageVersion"
+
+ - task: NuGetCommand@2
+ condition: succeeded()
+ displayName: Pack NuGet with Test Framework
+ inputs:
+ command: 'custom'
+ arguments: 'pack source\package.nuspec -Version $(NBGV_NuGetPackageVersion) -properties commit="$(Build.SourceVersion)"'
+
+ - task: CopyFiles@1
+ condition: succeeded()
+ displayName: Collecting NuGet package artifact
+ inputs:
+ sourceFolder: $(Build.SourcesDirectory)
+ Contents: |
+ **\nanoFramework.TestFramework*.nupkg
+ TargetFolder: '$(Build.ArtifactStagingDirectory)'
+ flattenFolders: true
+
+ - task: DotNetCoreCLI@2
+ displayName: Install SignTool tool
+ condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], '') )
+ inputs:
+ command: custom
+ custom: tool
+ arguments: install --tool-path . SignClient
+
+ - pwsh: |
+ .\SignClient "Sign" `
+ --baseDirectory "$(Build.ArtifactStagingDirectory)" `
+ --input "**/*.nupkg" `
+ --config "$(Build.Repository.LocalPath)\config\SignClient.json" `
+ --filelist "$(Build.Repository.LocalPath)\config\filelist.txt" `
+ --user "$(SignClientUser)" `
+ --secret '$(SignClientSecret)' `
+ --name "Test Framework" `
+ --description "Test Framework" `
+ --descriptionUrl "https://github.com/$env:Build_Repository_Name"
+ displayName: Sign packages
+ continueOnError: true
+ condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], '') )
+
+ # publish artifacts (only possible if this is not a PR originated on a fork)
+ - task: PublishBuildArtifacts@1
+ condition: and( succeeded(), ne(variables['system.pullrequest.isfork'], true) )
+ displayName: Publish deployables artifacts
+ inputs:
+ PathtoPublish: '$(Build.ArtifactStagingDirectory)'
+ ArtifactName: deployables
+ ArtifactType: Container
+
+ # push NuGet packages to Azure Artifacts feed (always happens except on PR builds)
+ - task: NuGetCommand@2
+ displayName: Push NuGet packages to Azure Artifacts
+ condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], '') )
+ continueOnError: true
+ inputs:
+ command: push
+ nuGetFeedType: external
+ packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
+ publishFeedCredentials: 'AzureArtifacts-$(System.TeamProject)'
+ allowPackageConflicts: true
+
+ # push NuGet class lib package to NuGet (always happens except on PR builds)
+ - task: NuGetCommand@2
+ condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), ne( variables['StartReleaseCandidate'], true ) )
+ continueOnError: true
+ displayName: Push NuGet packages to NuGet
+ inputs:
+ command: push
+ nuGetFeedType: external
+ allowPackageConflicts: true
+ packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
+ publishFeedCredentials: 'NuGet-$(System.TeamProject)'
+
+ # create or update GitHub release
+ - task: GitHubReleasePublish@1
+ inputs:
+ githubEndpoint: 'nanoFramework'
+ githubOwner: 'nanoframework'
+ githubRepositoryName: 'nanoFramework.TestPlatform'
+ githubTag: v$(GitBuildVersionSimple)
+ githubReleaseTitle: '.NET nanoFramework Unit Test Framework v$(GitBuildVersionSimple)'
+ githubReleaseNotes: 'add description here'
+ githubTargetCommitsh: $(Build.SourceVersion)
+ githubReleaseDraft: false
+ githubReleasePrerelease: true
+ githubReuseDraftOnly: false
+ githubReuseRelease: true
+ githubEditRelease: true
+ githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/*.nupkg'
+ condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
+ displayName: Create/Update GitHub release
+
+##############################
+- job: Update_Dependents
+ condition: and( or( eq(dependencies.Get_Build_Flags.outputs['GetPRLabels.RUN_UPDATE_DEPENDENTS'], 'true'), eq(variables['UPDATE_DEPENDENTS'], 'true') ), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
+
+ dependsOn:
+ - Get_Build_Flags
+ - Build_MDP
+
+ pool:
+ vmImage: 'windows-2019'
+
+ steps:
+ # need this here in order to persist GitHub credentials
+ - checkout: self
+ fetchDepth: 100
+
+ - template: azure-pipelines-templates/install-nbgv-tool.yml@templates
+
+ - task: NuGetToolInstaller@0
+ displayName: 'Install specific version of NuGet'
+ inputs:
+ versionSpec: '5.8.0'
+
+ - script: nbgv cloud -a -c
+ condition: succeeded()
+ displayName: Set build number
+
+ # update dependencies
+ - task: PowerShell@2
+ displayName: Update dependent class libs
+ inputs:
+ targetType: filePath
+ filePath: azure-pipelines/update-dependencies.ps1
+ env:
+ MY_GITHUB_TOKEN: $(GitHubToken)
+
+##################################
+# report build failure to Discord
+- job: Report_Build_Failure
+ dependsOn:
+ - Build_MDP
+ condition: failed('Build_MDP')
+
+ pool:
+ vmImage: 'windows-2019'
+
+ steps:
+
+ - checkout: self
+ fetchDepth: 1
+
+ # step from template @ nf-tools repo
+ - template: azure-pipelines-templates/discord-webhook.yml@templates
+ parameters:
+ status: 'failure'
+ webhookUrl: '$(DiscordWebhook)'
+ message: ''
diff --git a/azure-pipelines/update-dependencies.ps1 b/azure-pipelines/update-dependencies.ps1
new file mode 100644
index 0000000..79aea86
--- /dev/null
+++ b/azure-pipelines/update-dependencies.ps1
@@ -0,0 +1,118 @@
+"Updating dependency at nf-Visual-Studio-extension" | Write-Host
+
+# compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
+# 'encoded token' is the Base64 of the string "nfbot:personal-token"
+$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$env:MY_GITHUB_TOKEN"))))"
+
+# because it can take sometime for the package to become available on the NuGet providers
+# need to hang here for 1 minute (1 * 60)
+"Waiting 1 minute to let package process flow in Azure Artifacts feed..." | Write-Host
+Start-Sleep -Seconds 60
+
+# init/reset these
+$commitMessage = ""
+$prTitle = ""
+$newBranchName = "develop-nfbot/update-dependencies/" + [guid]::NewGuid().ToString()
+$packageTargetVersion = $env:NBGV_NuGetPackageVersion
+
+# working directory is agent temp directory
+Write-Debug "Changing working directory to $env:Agent_TempDirectory"
+Set-Location "$env:Agent_TempDirectory" | Out-Null
+
+# clone repo and checkout develop branch
+Write-Debug "Init and featch nf-Visual-Studio-extension repo"
+
+git clone --depth 1 https://github.com/nanoframework/nf-Visual-Studio-extension repo
+Set-Location repo | Out-Null
+git config --global gc.auto 0
+git config --global user.name nfbot
+git config --global user.email dependencybot@nanoframework.net
+git config --global core.autocrlf true
+
+Write-Host "Checkout develop branch..."
+git checkout --quiet develop | Out-Null
+
+####################
+# VS 2017
+
+Write-Host "Updating nanoFramework.TestFramework package in VS2017 solution..."
+
+dotnet remove VisualStudio.Extension\VisualStudio.Extension.csproj package nanoFramework.TestFramework
+
+dotnet add VisualStudio.Extension\VisualStudio.Extension.csproj package nanoFramework.TestFramework --prerelease -s https://pkgs.dev.azure.com/nanoframework/feed/_packaging/sandbox/nuget/v3/index.json
+
+####################
+# VS 2019
+
+Write-Host "Updating nanoFramework.TestFramework package in VS2019 solution..."
+
+dotnet remove VisualStudio.Extension-2019\VisualStudio.Extension.csproj package nanoFramework.TestFramework
+
+dotnet add VisualStudio.Extension-2019\VisualStudio.Extension.csproj package nanoFramework.TestFramework --prerelease -s https://pkgs.dev.azure.com/nanoframework/feed/_packaging/sandbox/nuget/v3/index.json
+
+#####################
+
+"Bumping nanoFramework.TestFramework to $packageTargetVersion." | Write-Host -ForegroundColor Cyan
+
+# build commit message
+$commitMessage += "Bumps nanoFramework.TestFramework to $packageTargetVersion.`n"
+# build PR title
+$prTitle = "Bumps nanoFramework.TestFramework to $packageTargetVersion"
+
+# need this line so nfbot flags the PR appropriately
+$commitMessage += "`n[version update]`n`n"
+
+# better add this warning line
+$commitMessage += "### :warning: This is an automated update. Merge only after all tests pass. :warning:`n"
+
+Write-Debug "Git branch"
+
+# create branch to perform updates
+git branch $newBranchName
+
+Write-Debug "Checkout branch"
+
+# checkout branch
+git checkout $newBranchName
+
+Write-Debug "Add changes"
+
+# commit changes
+git add -A > $null
+
+Write-Debug "Commit changed files"
+
+git commit -m "$prTitle ***NO_CI***" -m "$commitMessage" > $null
+
+Write-Debug "Push changes"
+
+git -c http.extraheader="AUTHORIZATION: $auth" push --set-upstream origin $newBranchName > $null
+
+# start PR
+# we are hardcoding to 'develop' branch to have a fixed one
+# this is very important for tags (which don't have branch information)
+# considering that the base branch can be changed at the PR ther is no big deal about this
+$prRequestBody = @{title="$prTitle";body="$commitMessage";head="$newBranchName";base="develop"} | ConvertTo-Json
+$githubApiEndpoint = "https://api.github.com/repos/nanoframework/nf-Visual-Studio-extension/pulls"
+[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+
+$headers = @{}
+$headers.Add("Authorization","$auth")
+$headers.Add("Accept","application/vnd.github.symmetra-preview+json")
+
+try
+{
+ $result = Invoke-RestMethod -Method Post -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::InternetExplorer -Uri $githubApiEndpoint -Header $headers -ContentType "application/json" -Body $prRequestBody
+ 'Started PR with dependencies update...' | Write-Host -NoNewline
+ 'OK' | Write-Host -ForegroundColor Green
+}
+catch
+{
+ $result = $_.Exception.Response.GetResponseStream()
+ $reader = New-Object System.IO.StreamReader($result)
+ $reader.BaseStream.Position = 0
+ $reader.DiscardBufferedData()
+ $responseBody = $reader.ReadToEnd();
+
+ throw "Error starting PR: $responseBody"
+}
diff --git a/config/SignClient.json b/config/SignClient.json
new file mode 100644
index 0000000..482177d
--- /dev/null
+++ b/config/SignClient.json
@@ -0,0 +1,14 @@
+{
+ "SignClient": {
+ "AzureAd": {
+ "AADInstance": "https://login.microsoftonline.com/",
+ "ClientId": "c248d68a-ba6f-4aa9-8a68-71fe872063f8",
+ "TenantId": "16076fdc-fcc1-4a15-b1ca-32c9a255900e"
+ },
+ "Service": {
+ "Url": "https://codesign.dotnetfoundation.org/",
+ "ResourceId": "https://SignService/3c30251f-36f3-490b-a955-520addb85001"
+ }
+ }
+ }
+
\ No newline at end of file
diff --git a/config/filelist.txt b/config/filelist.txt
new file mode 100644
index 0000000..dcf95ee
--- /dev/null
+++ b/config/filelist.txt
@@ -0,0 +1 @@
+**/nanoFramework.*
diff --git a/nanoFramework.TestAdapter.sln b/nanoFramework.TestAdapter.sln
new file mode 100644
index 0000000..a9018fe
--- /dev/null
+++ b/nanoFramework.TestAdapter.sln
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31005.135
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nanoFramework.TestAdapter", "source\TestAdapter\nanoFramework.TestAdapter.csproj", "{7B3026CA-1CBB-4F28-AC42-29CD22710877}"
+EndProject
+Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "TestFrameworkShared", "source\TestFrameworkShared\TestFrameworkShared.shproj", "{55F048B5-6739-43C5-A93D-DB61DB8E912F}"
+EndProject
+Global
+ GlobalSection(SharedMSBuildProjectFiles) = preSolution
+ source\TestFrameworkShared\TestFrameworkShared.projitems*{55f048b5-6739-43c5-a93d-db61db8e912f}*SharedItemsImports = 13
+ source\TestFrameworkShared\TestFrameworkShared.projitems*{7b3026ca-1cbb-4f28-ac42-29cd22710877}*SharedItemsImports = 5
+ EndGlobalSection
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7B3026CA-1CBB-4F28-AC42-29CD22710877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7B3026CA-1CBB-4F28-AC42-29CD22710877}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7B3026CA-1CBB-4F28-AC42-29CD22710877}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7B3026CA-1CBB-4F28-AC42-29CD22710877}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {8DC0B70D-F42F-4257-A336-60E93BE828D2}
+ EndGlobalSection
+EndGlobal
diff --git a/nanoFramework.TestFramework.sln b/nanoFramework.TestFramework.sln
new file mode 100644
index 0000000..65e308d
--- /dev/null
+++ b/nanoFramework.TestFramework.sln
@@ -0,0 +1,40 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31005.135
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "nanoFramework.UnitTestLauncher", "source\UnitTestLauncher\nanoFramework.UnitTestLauncher.nfproj", "{897FC4EA-823D-4343-8CC6-B6F28C3FF91E}"
+EndProject
+Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "nanoFramework.TestFramework", "source\TestFramework\nanoFramework.TestFramework.nfproj", "{D66A7774-AFAB-466B-9CFB-3485B02F4AF4}"
+EndProject
+Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "TestFrameworkShared", "source\TestFrameworkShared\TestFrameworkShared.shproj", "{55F048B5-6739-43C5-A93D-DB61DB8E912F}"
+EndProject
+Global
+ GlobalSection(SharedMSBuildProjectFiles) = preSolution
+ source\TestFrameworkShared\TestFrameworkShared.projitems*{55f048b5-6739-43c5-a93d-db61db8e912f}*SharedItemsImports = 13
+ EndGlobalSection
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {897FC4EA-823D-4343-8CC6-B6F28C3FF91E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {897FC4EA-823D-4343-8CC6-B6F28C3FF91E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {897FC4EA-823D-4343-8CC6-B6F28C3FF91E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {897FC4EA-823D-4343-8CC6-B6F28C3FF91E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {897FC4EA-823D-4343-8CC6-B6F28C3FF91E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {897FC4EA-823D-4343-8CC6-B6F28C3FF91E}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {D66A7774-AFAB-466B-9CFB-3485B02F4AF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D66A7774-AFAB-466B-9CFB-3485B02F4AF4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D66A7774-AFAB-466B-9CFB-3485B02F4AF4}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {D66A7774-AFAB-466B-9CFB-3485B02F4AF4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D66A7774-AFAB-466B-9CFB-3485B02F4AF4}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D66A7774-AFAB-466B-9CFB-3485B02F4AF4}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {45FCB25A-0B73-4A11-B3AC-29A48E46AB9C}
+ EndGlobalSection
+EndGlobal
diff --git a/poc/ConsoleApp3/App.config b/poc/ConsoleApp3/App.config
deleted file mode 100644
index 8324aa6..0000000
--- a/poc/ConsoleApp3/App.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/poc/ConsoleApp3/ConsoleApp3.csproj b/poc/ConsoleApp3/ConsoleApp3.csproj
deleted file mode 100644
index a1e4c70..0000000
--- a/poc/ConsoleApp3/ConsoleApp3.csproj
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}
- Exe
- ConsoleApp3
- ConsoleApp3
- v4.6
- 512
- true
- true
-
-
- AnyCPU
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- AnyCPU
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/poc/ConsoleApp3/Program.cs b/poc/ConsoleApp3/Program.cs
deleted file mode 100644
index d504f7b..0000000
--- a/poc/ConsoleApp3/Program.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace ConsoleApp3
-{
- class Program
- {
- static void Main(string[] args)
- {
- DateTime alarmTime = new DateTime(2018, 10, 29, 23, 30, 15);
-
- // c
- Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
-
- Console.WriteLine($"Set alarm time to {alarmTime.ToString("s")}");
-
- }
- }
-}
diff --git a/poc/ConsoleApp3/Properties/AssemblyInfo.cs b/poc/ConsoleApp3/Properties/AssemblyInfo.cs
deleted file mode 100644
index 4dd9589..0000000
--- a/poc/ConsoleApp3/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("ConsoleApp3")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ConsoleApp3")]
-[assembly: AssemblyCopyright("Copyright © 2018")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("cd1a924a-d2b8-4e51-bd01-ea71e61976d0")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/poc/NFApp3.sln b/poc/NFApp3.sln
deleted file mode 100644
index 544066d..0000000
--- a/poc/NFApp3.sln
+++ /dev/null
@@ -1,69 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.28010.2019
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "NFApp3", "NFApp3\NFApp3.nfproj", "{78E81FA7-C1BF-4F65-A45D-9736CA479649}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp3", "ConsoleApp3\ConsoleApp3.csproj", "{CD1A924A-D2B8-4E51-BD01-EA71E61976D0}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|ARM = Debug|ARM
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- Release|Any CPU = Release|Any CPU
- Release|ARM = Release|ARM
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Debug|ARM.Build.0 = Debug|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Debug|ARM.Deploy.0 = Debug|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Debug|x64.ActiveCfg = Debug|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Debug|x64.Build.0 = Debug|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Debug|x64.Deploy.0 = Debug|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Debug|x86.ActiveCfg = Debug|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Debug|x86.Build.0 = Debug|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Debug|x86.Deploy.0 = Debug|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Release|Any CPU.Build.0 = Release|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Release|Any CPU.Deploy.0 = Release|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Release|ARM.ActiveCfg = Release|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Release|ARM.Build.0 = Release|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Release|ARM.Deploy.0 = Release|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Release|x64.ActiveCfg = Release|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Release|x64.Build.0 = Release|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Release|x64.Deploy.0 = Release|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Release|x86.ActiveCfg = Release|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Release|x86.Build.0 = Release|Any CPU
- {78E81FA7-C1BF-4F65-A45D-9736CA479649}.Release|x86.Deploy.0 = Release|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Debug|ARM.ActiveCfg = Debug|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Debug|ARM.Build.0 = Debug|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Debug|x64.ActiveCfg = Debug|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Debug|x64.Build.0 = Debug|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Debug|x86.ActiveCfg = Debug|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Debug|x86.Build.0 = Debug|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Release|Any CPU.Build.0 = Release|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Release|ARM.ActiveCfg = Release|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Release|ARM.Build.0 = Release|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Release|x64.ActiveCfg = Release|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Release|x64.Build.0 = Release|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Release|x86.ActiveCfg = Release|Any CPU
- {CD1A924A-D2B8-4E51-BD01-EA71E61976D0}.Release|x86.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {78B87301-5203-4FB7-A6B0-758075F129BA}
- EndGlobalSection
-EndGlobal
diff --git a/poc/NFApp3/NFApp3.nfproj b/poc/NFApp3/NFApp3.nfproj
deleted file mode 100644
index 0203224..0000000
--- a/poc/NFApp3/NFApp3.nfproj
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
- $(MSBuildToolsPath)..\..\..\nanoFramework\v1.0\
-
-
-
-
- Debug
- AnyCPU
- {11A8DD76-328B-46DF-9F39-F559912D0360};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 15.0
- 78e81fa7-c1bf-4f65-a45d-9736ca479649
- Exe
- Properties
- 512
- NFApp3
- NFApp3
- v1.0
- true
- true
- True
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ..\packages\nanoFramework.CoreLibrary.1.0.1-preview127\lib\mscorlib.dll
- True
- True
-
-
- ..\packages\nanoFramework.TestFramework.1.0.0-preview010\lib\nanoFramework.TestPlatform.TestFramework.dll
- True
- True
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/poc/NFApp3/NFUnitTest1.cs b/poc/NFApp3/NFUnitTest1.cs
deleted file mode 100644
index 67af1b9..0000000
--- a/poc/NFApp3/NFUnitTest1.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System;
-
-namespace UnitTestProject1_mstest
-{
- [TestClass]
- public class UnitTest11
- {
- [TestMethod]
- public void TestMethod11()
- {
- }
- }
-}
diff --git a/poc/NFApp3/Program.cs b/poc/NFApp3/Program.cs
deleted file mode 100644
index dacd20f..0000000
--- a/poc/NFApp3/Program.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-using System;
-using System.Threading;
-
-namespace NFApp3
-{
- public class Program
- {
- public static void Main()
- {
- // need this?
- //Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI();
-
- //Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(e.Arguments);
-
- Thread.Sleep(Timeout.Infinite);
- }
- }
-}
diff --git a/poc/NFApp3/babel-test-proj.babel b/poc/NFApp3/babel-test-proj.babel
deleted file mode 100644
index f10fd5b..0000000
--- a/poc/NFApp3/babel-test-proj.babel
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
- bin\Debug\NFApp3.exe
- \[mscorlib\]System.Runtime.CompilerServices.CompilerGeneratedAttribute;\[mscorlib\]System.Diagnostics.DebuggerDisplayAttribute;\[mscorlib\]System.Diagnostics.DebuggerBrowsableAttribute;\[mscorlib\]System.Diagnostics.DebuggerNonUserCodeAttribute;\[mscorlib\]System.Diagnostics.DebuggerHiddenAttribute;\[mscorlib\]System.Diagnostics.DebuggerStepThroughAttribute;false
- false
- goto=true;switch=true;case=true;if=true;call=true;value=false;token=false;underflow=false;true
- false
- false
- false
- false
- None
- false
- true
- false
- true
- false
- false
- false
- 3
- false
- false
- true
- false
- false
- false
- true
- true
- true
- true
- true
- true
- false
- false
- false
- false
- true
- true
- true
- false
- false
- false
- false
- true
- false
- 1
- true
-
-
-
-
-
\ No newline at end of file
diff --git a/poc/NFApp3/local.runsettings b/poc/NFApp3/local.runsettings
deleted file mode 100644
index 3a70adc..0000000
--- a/poc/NFApp3/local.runsettings
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
- X86
- .NETFramework,Version=v4.6.1
-
-
diff --git a/poc/NFApp3/nanoFramework.runsettings b/poc/NFApp3/nanoFramework.runsettings
deleted file mode 100644
index 2f2162f..0000000
--- a/poc/NFApp3/nanoFramework.runsettings
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
- X86
- False
- Framework40
- True
- 10000
-
-
\ No newline at end of file
diff --git a/poc/NFApp3/packages.config b/poc/NFApp3/packages.config
deleted file mode 100644
index c4482f5..0000000
--- a/poc/NFApp3/packages.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/poc/NFUnit Test Demo.sln b/poc/NFUnit Test Demo.sln
new file mode 100644
index 0000000..65fea44
--- /dev/null
+++ b/poc/NFUnit Test Demo.sln
@@ -0,0 +1,27 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31019.35
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "NFUnitTest", "TestOfTestFramework\NFUnitTest.nfproj", "{FBD29C49-D7DC-425E-BAD1-1AE63484A6CD}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {FBD29C49-D7DC-425E-BAD1-1AE63484A6CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FBD29C49-D7DC-425E-BAD1-1AE63484A6CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FBD29C49-D7DC-425E-BAD1-1AE63484A6CD}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {FBD29C49-D7DC-425E-BAD1-1AE63484A6CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FBD29C49-D7DC-425E-BAD1-1AE63484A6CD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FBD29C49-D7DC-425E-BAD1-1AE63484A6CD}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {280DA13F-AFF7-4D5D-BA7F-BFC5E8F19995}
+ EndGlobalSection
+EndGlobal
diff --git a/poc/TestOfTestFramework/NFUnitTest.nfproj b/poc/TestOfTestFramework/NFUnitTest.nfproj
new file mode 100644
index 0000000..323a91b
--- /dev/null
+++ b/poc/TestOfTestFramework/NFUnitTest.nfproj
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ $(MSBuildToolsPath)..\..\..\nanoFramework\v1.0\
+
+
+
+ Debug
+ AnyCPU
+ {11A8DD76-328B-46DF-9F39-F559912D0360};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ fbd29c49-d7dc-425e-bad1-1ae63484a6cd
+ Library
+ Properties
+ 512
+ NFUnitTest
+ NFUnitTest
+ False
+ true
+ UnitTest
+ v4.0
+
+
+
+ $(MSBuildProjectDirectory)\nano.runsettings
+
+
+
+
+
+
+
+ ..\packages\nanoFramework.CoreLibrary.1.10.1-preview.9\lib\mscorlib.dll
+ True
+ True
+
+
+ ..\packages\nanoFramework.TestFramework.1.0.25\lib\nanoFramework.TestFramework.dll
+ True
+ True
+
+
+ ..\packages\nanoFramework.TestFramework.1.0.25\lib\nanoFramework.UnitTestLauncher.exe
+ True
+ True
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/poc/NFApp3/Properties/AssemblyInfo.cs b/poc/TestOfTestFramework/Properties/AssemblyInfo.cs
similarity index 80%
rename from poc/NFApp3/Properties/AssemblyInfo.cs
rename to poc/TestOfTestFramework/Properties/AssemblyInfo.cs
index 262254d..61f731f 100644
--- a/poc/NFApp3/Properties/AssemblyInfo.cs
+++ b/poc/TestOfTestFramework/Properties/AssemblyInfo.cs
@@ -31,3 +31,9 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
+
+/////////////////////////////////////////////////////////////////
+// This attribute is mandatory when building Interop libraries //
+// update this whenever the native assembly signature changes //
+[assembly: AssemblyNativeVersion("1.0.0.0")]
+/////////////////////////////////////////////////////////////////
diff --git a/poc/TestOfTestFramework/Test.cs b/poc/TestOfTestFramework/Test.cs
new file mode 100644
index 0000000..0591cd5
--- /dev/null
+++ b/poc/TestOfTestFramework/Test.cs
@@ -0,0 +1,172 @@
+//
+// Copyright (c) .NET Foundation and Contributors
+// Portions Copyright (c) Microsoft Corporation. All rights reserved.
+// See LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Diagnostics;
+
+namespace nanoFramework.TestFramework.Test
+{
+ [TestClass]
+ public class TestOfTest
+ {
+ [TestMethod]
+ public void TestRaisesException()
+ {
+ Debug.WriteLine("Test will raise exception");
+ Assert.Trows(typeof(Exception), ThrowMe);
+ }
+
+ private void ThrowMe()
+ {
+ throw new Exception("Test failed and it's a shame");
+ }
+
+ [TestMethod]
+ public void TestCheckAllEqual()
+ {
+ Debug.WriteLine("Test will check that all the Equal are actually equal");
+ // Arrange
+ byte bytea = 42; byte byteb = 42;
+ char chara = (char)42; char charb = (char)42;
+ sbyte sbytea = 42; sbyte sbyteb = 42;
+ int inta = 42; int intb = 42;
+ uint uinta = 42; uint uintb = 42;
+ long longa = 42; long longb = 42;
+ ulong ulonga = 42; ulong ulongb = 42;
+ bool boola = true; bool boolb = true;
+ short shorta = 42; short shortb = 42;
+ ushort ushorta = 42; ushort ushortb = 42;
+ float floata = 42; float floatb = 42;
+ int[] intArraya = new int[5] { 1, 2, 3, 4, 5 };
+ int[] intArrayb = new int[5] { 1, 2, 3, 4, 5 };
+ object obja = new object(); object objb = obja;
+ string stra = "42"; string strb = "42";
+ byte[] arrayempty = new byte[0];
+ // Assert
+ Assert.True(boola);
+ Assert.Equal(bytea, byteb);
+ Assert.Equal(chara, charb);
+ Assert.Equal(sbytea, sbyteb);
+ Assert.Equal(inta, intb);
+ Assert.Equal(uinta, uintb);
+ Assert.Equal(longa, longb);
+ Assert.Equal(ulonga, ulongb);
+ Assert.Equal(boola, boolb);
+ Assert.Equal(shorta, shortb);
+ Assert.Equal(ushorta, ushortb);
+ Assert.Equal(floata, floatb);
+ Assert.Equal(intArraya, intArrayb);
+ Assert.Equal(stra, strb);
+ Assert.Same(obja, objb);
+ Assert.Empty(arrayempty);
+ }
+
+ [TestMethod]
+ public void TestCheckAllNotEqual()
+ {
+ Debug.WriteLine("Test will check that all the NotEqual are actually equal");
+ // Arrange
+ byte bytea = 42; byte byteb = 43;
+ char chara = (char)42; char charb = (char)43;
+ sbyte sbytea = 42; sbyte sbyteb = 43;
+ int inta = 42; int intb = 43;
+ uint uinta = 42; uint uintb = 43;
+ long longa = 42; long longb = 43;
+ ulong ulonga = 42; ulong ulongb = 43;
+ bool boola = true; bool boolb = false;
+ short shorta = 42; short shortb = 43;
+ ushort ushorta = 42; ushort ushortb = 43;
+ float floata = 42; float floatb = 43;
+ int[] intArraya = new int[5] { 1, 2, 3, 4, 5 };
+ int[] intArrayb = new int[5] { 1, 2, 3, 4, 6 };
+ int[] intArraybis = new int[4] { 1, 2, 3, 4 };
+ int[] intArrayter = null;
+ object obja = new object(); object objb = new object();
+ string stra = "42"; string strb = "43";
+ // Assert
+ Assert.False(boolb);
+ Assert.NotEqual(bytea, byteb);
+ Assert.NotEqual(chara, charb);
+ Assert.NotEqual(sbytea, sbyteb);
+ Assert.NotEqual(inta, intb);
+ Assert.NotEqual(uinta, uintb);
+ Assert.NotEqual(longa, longb);
+ Assert.NotEqual(ulonga, ulongb);
+ Assert.NotEqual(boola, boolb);
+ Assert.NotEqual(shorta, shortb);
+ Assert.NotEqual(ushorta, ushortb);
+ Assert.NotEqual(floata, floatb);
+ Assert.NotEqual(intArraya, intArrayb);
+ Assert.NotEqual(intArraya, intArraybis);
+ Assert.NotEqual(intArraya, intArrayter);
+ Assert.NotEqual(stra, strb);
+ Assert.NotSame(obja, objb);
+ Assert.NotEmpty(intArraya);
+ }
+
+ [TestMethod]
+ public void TestNullEmpty()
+ {
+ Debug.WriteLine("Test null, not null, types");
+ // Arrange
+ object objnull = null;
+ object objnotnull = new object();
+ Type typea = typeof(int);
+ Type typeb = typeof(int);
+ Type typec = typeof(long);
+ // Assert
+ Assert.Null(objnull);
+ Assert.NotNull(objnotnull);
+ Assert.IsType(typea, typeb);
+ Assert.IsNotType(typea, typec);
+ }
+
+ [TestMethod]
+ public void TestStringComparison()
+ {
+ Debug.WriteLine("Test string, Contains, EndsWith, StartWith");
+ // Arrange
+ string tocontains = "this text contains and end with contains";
+ string startcontains = "contains start this text";
+ string contains = "contains";
+ string doesnotcontains = "this is totally something else";
+ string empty = string.Empty;
+ string stringnull = null;
+ // Assert
+ Assert.Contains(contains, tocontains);
+ Assert.DoesNotContains(contains, doesnotcontains);
+ Assert.DoesNotContains(contains, empty);
+ Assert.DoesNotContains(contains, stringnull);
+ Assert.StartsWith(contains, startcontains);
+ Assert.EndsWith(contains, tocontains);
+ }
+
+ [Setup]
+ public void RunSetup()
+ {
+ Debug.WriteLine("Setup");
+ }
+
+ public void Nothing()
+ {
+ Debug.WriteLine("Nothing and should not be called");
+ }
+
+ [Cleanup]
+ public void Cleanup()
+ {
+ Debug.WriteLine("Cleanup");
+ }
+ }
+
+ public class SomthingElse
+ {
+ public void NothingReally()
+ {
+ Debug.WriteLine("Test failed: This would never get through");
+ }
+ }
+}
diff --git a/poc/TestOfTestFramework/TestOfTestFramework.cs b/poc/TestOfTestFramework/TestOfTestFramework.cs
new file mode 100644
index 0000000..999cd72
--- /dev/null
+++ b/poc/TestOfTestFramework/TestOfTestFramework.cs
@@ -0,0 +1,172 @@
+//
+// Copyright (c) .NET Foundation and Contributors
+// Portions Copyright (c) Microsoft Corporation. All rights reserved.
+// See LICENSE file in the project root for full license information.
+//
+
+using System;
+using System.Diagnostics;
+
+namespace nanoFramework.TestFramework.Test
+{
+ [TestClass]
+ public class TestOfTest
+ {
+ [TestMethod]
+ public void TestRaisesException()
+ {
+ Debug.WriteLine("Test will raise exception");
+ Assert.Trows(typeof(Exception), ThrowMe);
+ }
+
+ private void ThrowMe()
+ {
+ throw new Exception("Test failed and it's a shame");
+ }
+
+ [TestMethod]
+ public void TestCheckAllEqual()
+ {
+ Debug.WriteLine("Test will check that all the Equal are actually equal");
+ // Arrange
+ byte bytea = 42; byte byteb = 42;
+ char chara = (char)42; char charb = (char)42;
+ sbyte sbytea = 42; sbyte sbyteb = 42;
+ int inta = 42; int intb = 42;
+ uint uinta = 42; uint uintb = 42;
+ long longa = 42; long longb = 42;
+ ulong ulonga = 42; ulong ulongb = 42;
+ bool boola = true; bool boolb = true;
+ short shorta = 42; short shortb = 42;
+ ushort ushorta = 42; ushort ushortb = 42;
+ float floata = 42; float floatb = 42;
+ int[] intArraya = new int[5] { 1, 2, 3, 4, 5 };
+ int[] intArrayb = new int[5] { 1, 2, 3, 4, 5 };
+ object obja = new object(); object objb = obja;
+ string stra = "42"; string strb = "42";
+ byte[] arrayempty = new byte[0];
+ // Assert
+ Assert.True(boola);
+ Assert.Equal(bytea, byteb);
+ Assert.Equal(chara, charb);
+ Assert.Equal(sbytea, sbyteb);
+ Assert.Equal(inta, intb);
+ Assert.Equal(uinta, uintb);
+ Assert.Equal(longa, longb);
+ Assert.Equal(ulonga, ulongb);
+ Assert.Equal(boola, boolb);
+ Assert.Equal(shorta, shortb);
+ Assert.Equal(ushorta, ushortb);
+ Assert.Equal(floata, floatb);
+ Assert.Equal(intArraya, intArrayb);
+ Assert.Equal(stra, strb);
+ Assert.Same(obja, objb);
+ Assert.Empty(arrayempty);
+ }
+
+ [TestMethod]
+ public void TestCheckAllNotEqual()
+ {
+ Debug.WriteLine("Test will check that all the NotEqual are actually equal");
+ // Arrange
+ byte bytea = 42; byte byteb = 43;
+ char chara = (char)42; char charb = (char)43;
+ sbyte sbytea = 42; sbyte sbyteb = 43;
+ int inta = 42; int intb = 43;
+ uint uinta = 42; uint uintb = 43;
+ long longa = 42; long longb = 43;
+ ulong ulonga = 42; ulong ulongb = 43;
+ bool boola = true; bool boolb = false;
+ short shorta = 42; short shortb = 43;
+ ushort ushorta = 42; ushort ushortb = 43;
+ float floata = 42; float floatb = 43;
+ int[] intArraya = new int[5] { 1, 2, 3, 4, 5 };
+ int[] intArrayb = new int[5] { 1, 2, 3, 4, 6 };
+ int[] intArraybis = new int[4] { 1, 2, 3, 4 };
+ int[] intArrayter = null;
+ object obja = new object(); object objb = new object();
+ string stra = "42"; string strb = "43";
+ // Assert
+ Assert.False(boolb);
+ Assert.NotEqual(bytea, byteb);
+ Assert.NotEqual(chara, charb);
+ Assert.NotEqual(sbytea, sbyteb);
+ Assert.NotEqual(inta, intb);
+ Assert.NotEqual(uinta, uintb);
+ Assert.NotEqual(longa, longb);
+ Assert.NotEqual(ulonga, ulongb);
+ Assert.NotEqual(boola, boolb);
+ Assert.NotEqual(shorta, shortb);
+ Assert.NotEqual(ushorta, ushortb);
+ Assert.NotEqual(floata, floatb);
+ Assert.NotEqual(intArraya, intArrayb);
+ Assert.NotEqual(intArraya, intArraybis);
+ Assert.NotEqual(intArraya, intArrayter);
+ Assert.NotEqual(stra, strb);
+ Assert.NotSame(obja, objb);
+ Assert.NotEmpty(intArraya);
+ }
+
+ [TestMethod]
+ public void TestNullEmpty()
+ {
+ Debug.WriteLine("Test null, not null, types");
+ // Arrange
+ object objnull = null;
+ object objnotnull = new object();
+ Type typea = typeof(int);
+ Type typeb = typeof(int);
+ Type typec = typeof(long);
+ // Assert
+ Assert.Null(objnull);
+ Assert.NotNull(objnotnull);
+ Assert.IsType(typea, typeb);
+ Assert.IsNotType(typea, typec);
+ }
+
+ [TestMethod]
+ public void TestStringComparison()
+ {
+ Debug.WriteLine("Test string, Contains, EndsWith, StartWith");
+ // Arrange
+ string tocontains = "this text contains and end with contains";
+ string startcontains = "contains start this text";
+ string contains = "contains";
+ string doesnotcontains = "this is totally something else";
+ string empty = string.Empty;
+ string stringnull = null;
+ // Assert
+ Assert.Contains(contains, tocontains);
+ Assert.DoesNotContains(contains, doesnotcontains);
+ Assert.DoesNotContains(contains, empty);
+ Assert.DoesNotContains(contains, stringnull);
+ Assert.StartsWith(contains, startcontains);
+ Assert.EndsWith(contains, tocontains);
+ }
+
+ [Setup]
+ public void RunSetup()
+ {
+ Debug.WriteLine("Setup");
+ }
+
+ public void Nothing()
+ {
+ Debug.WriteLine("Nothing and should not be called");
+ }
+
+ [Cleanup]
+ public void Cleanup()
+ {
+ Debug.WriteLine("Cleanup");
+ }
+ }
+
+ public class SomthingElse
+ {
+ public void NothingReally()
+ {
+ Debug.WriteLine("Test failed: This would never get thru");
+ }
+ }
+}
diff --git a/poc/TestOfTestFramework/nano.runsettings b/poc/TestOfTestFramework/nano.runsettings
new file mode 100644
index 0000000..62f0a00
--- /dev/null
+++ b/poc/TestOfTestFramework/nano.runsettings
@@ -0,0 +1,13 @@
+
+
+
+
+ 1
+ .\TestResults
+ 120000
+ Framework40
+
+
+ None
+
+
\ No newline at end of file
diff --git a/poc/TestOfTestFramework/packages.config b/poc/TestOfTestFramework/packages.config
new file mode 100644
index 0000000..dcab08b
--- /dev/null
+++ b/poc/TestOfTestFramework/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/source/Build/nanoFramework.MSTest.TestAdapter.props b/source/Build/nanoFramework.MSTest.TestAdapter.props
index a5fe68c..811d687 100644
--- a/source/Build/nanoFramework.MSTest.TestAdapter.props
+++ b/source/Build/nanoFramework.MSTest.TestAdapter.props
@@ -1,8 +1,9 @@
+
-
+
-
- nanoFramework.TestPlatform.TestAdapter.dll
+
+ nanoFramework.TestPlatform.dll
PreserveNewest
False
diff --git a/source/Nuget.nanoFramework.TestAdapter/Nuget.nanoFramework.TestAdapter.nuproj b/source/Nuget.nanoFramework.TestAdapter/Nuget.nanoFramework.TestAdapter.nuproj
deleted file mode 100644
index d59dd02..0000000
--- a/source/Nuget.nanoFramework.TestAdapter/Nuget.nanoFramework.TestAdapter.nuproj
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
-
-
- Release
- AnyCPU
-
-
-
-
- [14.0.0]
- net461
-
-
-
-
- build\_common\nanoFramework.TestPlatform.TestAdapter.dll
-
-
- build\nanoFramework10\nanoFramework.MSTest.TestAdapter.props
-
-
-
- 9607C081-2415-465C-8424-1D8C28D4C0AC
-
-
- ..\packages\NuProj.0.20.4-beta\tools\
-
-
-
- nanoFramework.TestAdapter
- 1.0.4
- nanoFramework.TestAdapter
- jassimoes
- jassimoes
- nanoFramework.TestAdapter
- nanoFramework.TestAdapter
-
-
-
-
-
-
- Copyright © jassimoes
- nanoFramework.TestAdapter
-
-
-
\ No newline at end of file
diff --git a/source/Nuget.nanoFramework.TestFramework/Nuget.nanoFramework.TestFramework.nuproj b/source/Nuget.nanoFramework.TestFramework/Nuget.nanoFramework.TestFramework.nuproj
deleted file mode 100644
index 5d9fb83..0000000
--- a/source/Nuget.nanoFramework.TestFramework/Nuget.nanoFramework.TestFramework.nuproj
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
-
-
- Release
- AnyCPU
-
-
-
-
- lib\nanoFramework.TestPlatform.TestFramework.dll
-
-
- lib\nanoFramework.TestPlatform.TestFramework.pdb
-
-
- lib\nanoFramework.TestPlatform.TestFramework.pdbx
-
-
- lib\nanoFramework.TestPlatform.TestFramework.pe
-
-
-
- 9d39a999-0427-4238-b882-4878e3edb9ad
-
-
- ..\packages\NuProj.0.20.4-beta\tools\
-
-
-
- nanoFramework.TestFramework
- 1.0.0-preview010
- nanoFramework.TestFramework
- jassimoes
- jassimoes
- nanoFramework.TestFramework
- nanoFramework.TestFramework
-
-
-
-
-
-
- Copyright © jassimoes
- nanoFramework.TestFramework
-
-
-
\ No newline at end of file
diff --git a/source/TestAdapter/AssemblyResolver.cs b/source/TestAdapter/AssemblyResolver.cs
deleted file mode 100644
index 19d863c..0000000
--- a/source/TestAdapter/AssemblyResolver.cs
+++ /dev/null
@@ -1,682 +0,0 @@
-//
-// Copyright (c) 2018 The nanoFramework project contributors
-// Portions Copyright (c) Microsoft Corporation. All rights reserved.
-// See LICENSE file in the project root for full license information.
-//
-
-namespace nanoFramework.TestPlatform.MSTest.TestAdapter
-{
- using Microsoft.VisualStudio.TestPlatform.ObjectModel;
- using nanoFramework.TestPlatform.MSTest.TestAdapter.PlatformServices;
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.IO;
- using System.Linq;
- using System.Reflection;
-
- ///
- /// Helps resolve MSTestFramework assemblies for CLR loader.
- /// The idea is that Unit Test Adapter creates App Domain for running tests and sets AppBase to tests dir.
- /// Since we don't want to put our assemblies to GAC and they are not in tests dir, we use custom way to resolve them.
- ///
- public class AssemblyResolver : MarshalByRefObject, IDisposable
- {
-
- ///
- /// This will have the list of all directories read from runsettings.
- ///
- private Queue directoryList;
-
- ///
- /// The directories to look for assemblies to resolve.
- ///
- private List searchDirectories;
-
- ///
- /// Dictionary of Assemblies discovered to date.
- ///
- private Dictionary resolvedAssemblies = new Dictionary();
-
- ///
- /// Dictionary of Reflection-Only Assemblies discovered to date.
- ///
- private Dictionary reflectionOnlyResolvedAssemblies = new Dictionary();
-
- ///
- /// lock for the loaded assemblies cache.
- ///
- private object syncLock = new object();
-
- private bool disposed;
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// A list of directories for resolution path
- ///
- ///
- /// If there are additonal paths where a recursive search is required
- /// call AddSearchDirectoryFromRunSetting method with that list.
- ///
- public AssemblyResolver(
- IList directories
- )
- {
- if (directories == null || directories.Count == 0)
- {
- throw new ArgumentNullException("directories");
- }
-
- this.searchDirectories = new List(directories);
- this.directoryList = new Queue();
-
- AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(this.OnResolve);
- AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += new ResolveEventHandler(this.ReflectionOnlyOnResolve);
- }
-
- ///
- /// Finalizes an instance of the class.
- ///
- ~AssemblyResolver()
- {
- this.Dispose(false);
- }
-
- ///
- /// The dispose.
- ///
- public void Dispose()
- {
- this.Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- ///
- /// Returns object to be used for controlling lifetime, null means infinite lifetime.
- ///
- ///
- /// The .
- ///
- public override object InitializeLifetimeService()
- {
- return null;
- }
-
- ///
- /// It will add a list of search directories path with property recursive/non-recursive in assembly resolver .
- ///
- ///
- /// The recursive Directory Path.
- ///
- public void AddSearchDirectoriesFromRunSetting(
- List recursiveDirectoryPath
- )
- {
- // Enqueue elements from the list in Queue
- if (recursiveDirectoryPath == null)
- {
- return;
- }
-
- foreach (var recPath in recursiveDirectoryPath)
- {
- this.directoryList.Enqueue(recPath);
- }
- }
-
- ///
- /// Assembly Resolve event handler for App Domain - called when CLR loader cannot resolve assembly.
- ///
- /// The sender App Domain.
- /// The args.
- /// The .
- internal Assembly ReflectionOnlyOnResolve(
- object sender,
- ResolveEventArgs args
- )
- {
- return this.OnResolveInternal(sender, args, true);
- }
-
- ///
- /// Assembly Resolve event handler for App Domain - called when CLR loader cannot resolve assembly.
- ///
- /// The sender App Domain.
- /// The args.
- /// The .
- internal Assembly OnResolve(
- object sender,
- ResolveEventArgs args
- )
- {
- return this.OnResolveInternal(sender, args, false);
- }
-
- ///
- /// Adds the subdirectories of the provided path to the collection.
- ///
- /// Path go get subdirectories for.
- /// The search Directories.
- internal void AddSubdirectories(
- string path,
- List searchDirectories
- )
- {
- Debug.Assert(!string.IsNullOrEmpty(path), "'path' cannot be null or empty.");
- Debug.Assert(searchDirectories != null, "'searchDirectories' cannot be null.");
-
- // If the directory exists, get it's subdirectories
- if (this.DoesDirectoryExist(path))
- {
- // Get the directories in the path provided.
- var directories = this.GetDirectories(path);
-
- // Add each directory and its subdirectories to the collection.
- foreach (var directory in directories)
- {
- searchDirectories.Add(directory);
-
- this.AddSubdirectories(directory, searchDirectories);
- }
- }
- }
-
- ///
- /// The dispose.
- ///
- ///
- /// The disposing.
- ///
- protected virtual void Dispose(
- bool disposing
- )
- {
- if (!this.disposed)
- {
- if (disposing)
- {
- // cleanup Managed resourceslike calling dispose on other managed object created.
- AppDomain.CurrentDomain.AssemblyResolve -= new ResolveEventHandler(this.OnResolve);
- AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve -= new ResolveEventHandler(this.ReflectionOnlyOnResolve);
- }
-
- // cleanup native resources
- this.disposed = true;
- }
- }
-
- ///
- /// Verifies if a directory exists.
- ///
- /// The path to the directory.
- /// True if the directory exists.
- /// Only present for unit testing scenarios.
- protected virtual bool DoesDirectoryExist(
- string path
- )
- {
- return Directory.Exists(path);
- }
-
- ///
- /// Gets the directories from a path.
- ///
- /// The path to the directory.
- /// A list of directories in path.
- /// Only present for unit testing scenarios.
- protected virtual string[] GetDirectories(
- string path
- )
- {
- return Directory.GetDirectories(path);
- }
-
- protected virtual bool DoesFileExist(
- string filePath
- )
- {
- return File.Exists(filePath);
- }
-
- protected virtual Assembly LoadAssemblyFrom(
- string path
- )
- {
- return Assembly.LoadFrom(path);
- }
-
- protected virtual Assembly ReflectionOnlyLoadAssemblyFrom(
- string path
- )
- {
- return Assembly.ReflectionOnlyLoadFrom(path);
- }
-
- ///
- /// It will search for a particular assembly in the given list of directory.
- ///
- /// The search Directorypaths.
- /// The name.
- /// Indicates whether this is called under a Reflection Only Load context.
- /// The .
- protected virtual Assembly SearchAssembly(
- List searchDirectorypaths,
- string name,
- bool isReflectionOnly
- )
- {
- if (searchDirectorypaths == null || searchDirectorypaths.Count == 0)
- {
- return null;
- }
-
- // args.Name is like: "Microsoft.VisualStudio.TestTools.Common, Version=[VersionMajor].0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
- AssemblyName requestedName = null;
-
- try
- {
- // Can throw ArgumentException, FileLoadException if arg is empty/wrong format, etc. Should not return null.
- requestedName = new AssemblyName(name);
- }
- catch (Exception ex)
- {
- this.SafeLog(
- name,
- () =>
- {
- if (EqtTrace.IsInfoEnabled)
- {
- EqtTrace.Info(
- "AssemblyResolver: {0}: Failed to create assemblyName. Reason:{1} ",
- name,
- ex);
- }
- });
-
- return null;
- }
-
- Debug.Assert(requestedName != null && !string.IsNullOrEmpty(requestedName.Name), "AssemblyResolver.OnResolve: requested is null or name is empty!");
-
- foreach (var dir in searchDirectorypaths)
- {
- if (string.IsNullOrEmpty(dir))
- {
- continue;
- }
-
- this.SafeLog(
- name,
- () =>
- {
- if (EqtTrace.IsVerboseEnabled)
- {
- EqtTrace.Verbose("AssemblyResolver: Searching assembly: {0} in the directory: {1}", requestedName.Name, dir);
- }
- });
-
- foreach (var extension in new string[] { ".dll", ".exe" })
- {
- var assemblyPath = Path.Combine(dir, requestedName.Name + extension);
-
- var assembly = this.SearchAndLoadAssembly(assemblyPath, name, requestedName, isReflectionOnly);
- if (assembly != null)
- {
- return assembly;
- }
- }
- }
-
- return null;
- }
-
- ///
- /// Verifies that found assembly name matches requested to avoid security issues.
- /// Looks only at PublicKeyToken and Version, empty matches anything.
- ///
- /// The requested Name.
- /// The found Name.
- /// The .
- private static bool RequestedAssemblyNameMatchesFound(
- AssemblyName requestedName,
- AssemblyName foundName
- )
- {
- Debug.Assert(requestedName != null, "requested assembly name should not be null.");
- Debug.Assert(foundName != null, "found assembly name should not be null.");
-
- var requestedPublicKey = requestedName.GetPublicKeyToken();
- if (requestedPublicKey != null)
- {
- var foundPublicKey = foundName.GetPublicKeyToken();
- if (foundPublicKey == null)
- {
- return false;
- }
-
- for (var i = 0; i < requestedPublicKey.Length; ++i)
- {
- if (requestedPublicKey[i] != foundPublicKey[i])
- {
- return false;
- }
- }
- }
-
- return requestedName.Version == null || requestedName.Version.Equals(foundName.Version);
- }
-
- ///
- /// Assembly Resolve event handler for App Domain - called when CLR loader cannot resolve assembly.
- ///
- /// The sender App Domain.
- /// The args.
- /// Indicates whether this is called under a Reflection Only Load context.
- /// The .
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Requirement is to handle all kinds of user exceptions and message appropriately.")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "senderAppDomain", Justification = "This is an event handler.")]
- private Assembly OnResolveInternal(
- object senderAppDomain,
- ResolveEventArgs args,
- bool isReflectionOnly
- )
- {
- if (string.IsNullOrEmpty(args?.Name))
- {
- Debug.Assert(false, "AssemblyResolver.OnResolve: args.Name is null or empty.");
- return null;
- }
-
- this.SafeLog(
- args.Name,
- () =>
- {
- if (EqtTrace.IsInfoEnabled)
- {
- EqtTrace.Info("AssemblyResolver: Resolving assembly: {0}.", args.Name);
- }
- });
-
- string assemblyNameToLoad = AppDomain.CurrentDomain.ApplyPolicy(args.Name);
-
- this.SafeLog(
- assemblyNameToLoad,
- () =>
- {
- if (EqtTrace.IsInfoEnabled)
- {
- EqtTrace.Info("AssemblyResolver: Resolving assembly after applying policy: {0}.", assemblyNameToLoad);
- }
- });
-
- lock (this.syncLock)
- {
- // Since both normal and reflection only cache are accessed in same block, putting only one lock should be sufficient.
- Assembly assembly = null;
-
- if (this.TryLoadFromCache(assemblyNameToLoad, isReflectionOnly, out assembly))
- {
- return assembly;
- }
-
- assembly = this.SearchAssembly(this.searchDirectories, assemblyNameToLoad, isReflectionOnly);
-
- if (assembly != null)
- {
- return assembly;
- }
-
- if (this.directoryList != null && this.directoryList.Any())
- {
- // required assembly is not present in searchDirectories??
- // see, if we can find it in user specified search directories.
- while (assembly == null && this.directoryList.Count > 0)
- {
- // instead of loading whole saerch directory in one time, we are adding directory on the basis of need
- var currentNode = this.directoryList.Dequeue();
-
- List increamentalSearchDirectory = new List();
-
- if (this.DoesDirectoryExist(currentNode.DirectoryPath))
- {
- increamentalSearchDirectory.Add(currentNode.DirectoryPath);
-
- if (currentNode.IncludeSubDirectories)
- {
- // Add all its sub-directory in depth first search order.
- this.AddSubdirectories(currentNode.DirectoryPath, increamentalSearchDirectory);
- }
-
- // Add this directory list in this.searchDirectories so that when we will try to resolve some other
- // assembly, then it will look in this whole directory first.
- this.searchDirectories.AddRange(increamentalSearchDirectory);
-
- assembly = this.SearchAssembly(increamentalSearchDirectory, assemblyNameToLoad, isReflectionOnly);
- }
- else
- {
- // generate warning that path does not exist.
- this.SafeLog(
- assemblyNameToLoad,
- () =>
- {
- if (EqtTrace.IsWarningEnabled)
- {
- EqtTrace.Warning(
- "The Directory: {0}, does not exist",
- currentNode.DirectoryPath);
- }
- });
- }
- }
-
- if (assembly != null)
- {
- return assembly;
- }
- }
-
- // Try for default load for System dlls that can't be found in search paths. Needs to loaded just by name.
- try
- {
- if (isReflectionOnly)
- {
- // Put it in the resolved assembly cache so that if the Load call below
- // triggers another assembly resolution, then we dont end up in stack overflow.
- this.reflectionOnlyResolvedAssemblies[assemblyNameToLoad] = null;
-
- assembly = Assembly.ReflectionOnlyLoad(assemblyNameToLoad);
-
- if (assembly != null)
- {
- this.reflectionOnlyResolvedAssemblies[assemblyNameToLoad] = assembly;
- }
- }
- else
- {
- // Put it in the resolved assembly cache so that if the Load call below
- // triggers another assembly resolution, then we dont end up in stack overflow.
- this.resolvedAssemblies[assemblyNameToLoad] = null;
-
- assembly = Assembly.Load(assemblyNameToLoad);
-
- if (assembly != null)
- {
- this.resolvedAssemblies[assemblyNameToLoad] = assembly;
- }
- }
-
- return assembly;
- }
- catch (Exception ex)
- {
- this.SafeLog(
- args?.Name,
- () =>
- {
- if (EqtTrace.IsInfoEnabled)
- {
- EqtTrace.Info(
- "AssemblyResolver: {0}: Failed to load assembly. Reason:{1} ",
- assemblyNameToLoad,
- ex);
- }
- });
- }
-
- return assembly;
- }
- }
-
- ///
- /// Load assembly from cache if available.
- ///
- /// The assembly Name.
- /// Indicates if this is a reflection-only context.
- /// The assembly.
- /// The .
- private bool TryLoadFromCache(
- string assemblyName,
- bool isReflectionOnly,
- out Assembly assembly
- )
- {
- bool isFoundInCache = false;
-
- if (isReflectionOnly)
- {
- isFoundInCache = this.reflectionOnlyResolvedAssemblies.TryGetValue(assemblyName, out assembly);
- }
- else
- {
- isFoundInCache = this.resolvedAssemblies.TryGetValue(assemblyName, out assembly);
- }
-
- if (isFoundInCache)
- {
- this.SafeLog(
- assemblyName,
- () =>
- {
- if (EqtTrace.IsInfoEnabled)
- {
- EqtTrace.Info("AssemblyResolver: Resolved: {0}.", assemblyName);
- }
- });
- return true;
- }
-
- return false;
- }
-
- ///
- /// Call logger APIs safely. We do not want a stackoverflow when objectmodel assembly itself
- /// is being resolved and an EqtTrace message prompts the load of the same dll again.
- /// CLR does not trigger a load when the EqtTrace messages are in a lamda expression. Leaving it that way
- /// to preserve readability instead of creating wrapper functions.
- ///
- /// The assembly being rsolved.
- /// The logger function.
- private void SafeLog(
- string assemblyName,
- Action loggerAction
- )
- {
- if (!string.IsNullOrEmpty(assemblyName) && !assemblyName.StartsWith(Constants.LoggerAssemblyName))
- {
- loggerAction.Invoke();
- }
- }
-
- ///
- /// Search for assembly and if exists then load.
- ///
- /// The assembly Path.
- /// The assembly Name.
- /// The requested Name.
- /// Indicates whether this is called under a Reflection Only Load context.
- /// The .
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId = "System.Reflection.Assembly.LoadFrom", Justification = "The assembly location is fugred out from the configuration that the user passes in.")]
- [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Requirement is to handle all kinds of user exceptions and message appropriately.")]
- private Assembly SearchAndLoadAssembly(
- string assemblyPath,
- string assemblyName,
- AssemblyName requestedName,
- bool isReflectionOnly
- )
- {
- try
- {
- if (!this.DoesFileExist(assemblyPath))
- {
- return null;
- }
-
- var foundName = AssemblyName.GetAssemblyName(assemblyPath);
-
- if (!RequestedAssemblyNameMatchesFound(requestedName, foundName))
- {
- return null; // File exists but version/public key is wrong. Try next extension.
- }
-
- Assembly assembly;
-
- if (isReflectionOnly)
- {
- assembly = this.ReflectionOnlyLoadAssemblyFrom(assemblyPath);
- this.reflectionOnlyResolvedAssemblies[assemblyName] = assembly;
- }
- else
- {
- assembly = this.LoadAssemblyFrom(assemblyPath);
- this.resolvedAssemblies[assemblyName] = assembly;
- }
-
- this.SafeLog(
- assemblyName,
- () =>
- {
- if (EqtTrace.IsInfoEnabled)
- {
- EqtTrace.Info("AssemblyResolver: Resolved assembly: {0}. ", assemblyName);
- }
- });
- return assembly;
- }
- catch (FileLoadException ex)
- {
- this.SafeLog(
- assemblyName,
- () =>
- {
- if (EqtTrace.IsInfoEnabled)
- {
- EqtTrace.Info("AssemblyResolver: Failed to load assembly: {0}. Reason:{1} ", assemblyName, ex);
- }
- });
-
- // Rethrow FileLoadException, because this exception means that the assembly
- // was found, but could not be loaded. This will allow us to report a more
- // specific error message to the user for things like access denied.
- throw;
- }
- catch (Exception ex)
- {
- // For all other exceptions, try the next extension.
- this.SafeLog(
- assemblyName,
- () =>
- {
- if (EqtTrace.IsInfoEnabled)
- {
- EqtTrace.Info("AssemblyResolver: Failed to load assembly: {0}. Reason:{1} ", assemblyName, ex);
- }
- });
- }
-
- return null;
- }
- }
-}
diff --git a/source/TestAdapter/Assertions/Assert.cs b/source/TestAdapter/Assertions/Assert.cs
deleted file mode 100644
index 5f34b22..0000000
--- a/source/TestAdapter/Assertions/Assert.cs
+++ /dev/null
@@ -1,2371 +0,0 @@
-//
-// Copyright (c) 2018 The nanoFramework project contributors
-// Portions Copyright (c) Microsoft Corporation. All rights reserved.
-// See LICENSE file in the project root for full license information.
-//
-
-namespace nanoFramework.TestPlatform.MSTest.TestAdapter
-{
- using nanoFramework.TestPlatform.MSTest.TestAdapter.Resources;
- using System;
- using System.Diagnostics.CodeAnalysis;
- using System.Globalization;
- using System.Reflection;
- using System.Threading.Tasks;
-
- ///
- /// A collection of helper classes to test various conditions within
- /// unit tests. If the condition being tested is not met, an exception
- /// is thrown.
- ///
- public sealed class Assert
- {
- private static Assert that;
-
- #region Singleton constructor
-
- private Assert()
- {
- }
-
- ///
- /// Gets the singleton instance of the Assert functionality.
- ///
- ///
- /// Users can use this to plug-in custom assertions through C# extension methods.
- /// For instance, the signature of a custom assertion provider could be "public static void IsOfType<T>(this Assert assert, object obj)"
- /// Users could then use a syntax similar to the default assertions which in this case is "Assert.That.IsOfType<Dog>(animal);"
- /// More documentation is at "https://github.com/Microsoft/testfx-docs".
- ///
- public static Assert That
- {
- get
- {
- if (that == null)
- {
- that = new Assert();
- }
-
- return that;
- }
- }
-
- #endregion
-
- #region Boolean
-
- ///
- /// Tests whether the specified condition is true and throws an exception
- /// if the condition is false.
- ///
- ///
- /// The condition the test expects to be true.
- ///
- ///
- /// Thrown if is false.
- ///
- public static void IsTrue(bool condition)
- {
- IsTrue(condition, string.Empty, null);
- }
-
- ///
- /// Tests whether the specified condition is true and throws an exception
- /// if the condition is false.
- ///
- ///
- /// The condition the test expects to be true.
- ///
- ///
- /// The message to include in the exception when
- /// is false. The message is shown in test results.
- ///
- ///
- /// Thrown if is false.
- ///
- public static void IsTrue(bool condition, string message)
- {
- IsTrue(condition, message, null);
- }
-
- ///
- /// Tests whether the specified condition is true and throws an exception
- /// if the condition is false.
- ///
- ///
- /// The condition the test expects to be true.
- ///
- ///
- /// The message to include in the exception when
- /// is false. The message is shown in test results.
- ///
- ///
- /// An array of parameters to use when formatting .
- ///
- ///
- /// Thrown if is false.
- ///
- public static void IsTrue(bool condition, string message, params object[] parameters)
- {
- if (!condition)
- {
- HandleFail("Assert.IsTrue", message, parameters);
- }
- }
-
- ///
- /// Tests whether the specified condition is false and throws an exception
- /// if the condition is true.
- ///
- ///
- /// The condition the test expects to be false.
- ///
- ///
- /// Thrown if is true.
- ///
- public static void IsFalse(bool condition)
- {
- IsFalse(condition, string.Empty, null);
- }
-
- ///
- /// Tests whether the specified condition is false and throws an exception
- /// if the condition is true.
- ///
- ///
- /// The condition the test expects to be false.
- ///
- ///
- /// The message to include in the exception when
- /// is true. The message is shown in test results.
- ///
- ///
- /// Thrown if is true.
- ///
- public static void IsFalse(bool condition, string message)
- {
- IsFalse(condition, message, null);
- }
-
- ///
- /// Tests whether the specified condition is false and throws an exception
- /// if the condition is true.
- ///
- ///
- /// The condition the test expects to be false.
- ///
- ///
- /// The message to include in the exception when
- /// is true. The message is shown in test results.
- ///
- ///
- /// An array of parameters to use when formatting .
- ///
- ///
- /// Thrown if is true.
- ///
- public static void IsFalse(bool condition, string message, params object[] parameters)
- {
- if (condition)
- {
- HandleFail("Assert.IsFalse", message, parameters);
- }
- }
-
- #endregion
-
- #region Null
-
- ///
- /// Tests whether the specified object is null and throws an exception
- /// if it is not.
- ///
- ///
- /// The object the test expects to be null.
- ///
- ///
- /// Thrown if is not null.
- ///
- public static void IsNull(object value)
- {
- IsNull(value, string.Empty, null);
- }
-
- ///
- /// Tests whether the specified object is null and throws an exception
- /// if it is not.
- ///
- ///
- /// The object the test expects to be null.
- ///
- ///
- /// The message to include in the exception when
- /// is not null. The message is shown in test results.
- ///
- ///
- /// Thrown if is not null.
- ///
- public static void IsNull(object value, string message)
- {
- IsNull(value, message, null);
- }
-
- ///
- /// Tests whether the specified object is null and throws an exception
- /// if it is not.
- ///
- ///
- /// The object the test expects to be null.
- ///
- ///
- /// The message to include in the exception when
- /// is not null. The message is shown in test results.
- ///
- ///
- /// An array of parameters to use when formatting .
- ///
- ///
- /// Thrown if is not null.
- ///
- public static void IsNull(object value, string message, params object[] parameters)
- {
- if (value != null)
- {
- HandleFail("Assert.IsNull", message, parameters);
- }
- }
-
- ///
- /// Tests whether the specified object is non-null and throws an exception
- /// if it is null.
- ///
- ///
- /// The object the test expects not to be null.
- ///
- ///
- /// Thrown if is null.
- ///
- public static void IsNotNull(object value)
- {
- IsNotNull(value, string.Empty, null);
- }
-
- ///
- /// Tests whether the specified object is non-null and throws an exception
- /// if it is null.
- ///
- ///
- /// The object the test expects not to be null.
- ///
- ///
- /// The message to include in the exception when
- /// is null. The message is shown in test results.
- ///
- ///
- /// Thrown if is null.
- ///
- public static void IsNotNull(object value, string message)
- {
- IsNotNull(value, message, null);
- }
-
- ///
- /// Tests whether the specified object is non-null and throws an exception
- /// if it is null.
- ///
- ///
- /// The object the test expects not to be null.
- ///
- ///
- /// The message to include in the exception when
- /// is null. The message is shown in test results.
- ///
- ///
- /// An array of parameters to use when formatting .
- ///
- ///
- /// Thrown if is null.
- ///
- public static void IsNotNull(object value, string message, params object[] parameters)
- {
- if (value == null)
- {
- HandleFail("Assert.IsNotNull", message, parameters);
- }
- }
-
- #endregion
-
- #region AreSame
-
- ///
- /// Tests whether the specified objects both refer to the same object and
- /// throws an exception if the two inputs do not refer to the same object.
- ///
- ///
- /// The first object to compare. This is the value the test expects.
- ///
- ///
- /// The second object to compare. This is the value produced by the code under test.
- ///
- ///
- /// Thrown if does not refer to the same object
- /// as .
- ///
- public static void AreSame(object expected, object actual)
- {
- AreSame(expected, actual, string.Empty, null);
- }
-
- ///
- /// Tests whether the specified objects both refer to the same object and
- /// throws an exception if the two inputs do not refer to the same object.
- ///
- ///
- /// The first object to compare. This is the value the test expects.
- ///
- ///
- /// The second object to compare. This is the value produced by the code under test.
- ///
- ///
- /// The message to include in the exception when
- /// is not the same as . The message is shown
- /// in test results.
- ///
- ///
- /// Thrown if does not refer to the same object
- /// as .
- ///
- public static void AreSame(object expected, object actual, string message)
- {
- AreSame(expected, actual, message, null);
- }
-
- ///
- /// Tests whether the specified objects both refer to the same object and
- /// throws an exception if the two inputs do not refer to the same object.
- ///
- ///
- /// The first object to compare. This is the value the test expects.
- ///
- ///
- /// The second object to compare. This is the value produced by the code under test.
- ///
- ///
- /// The message to include in the exception when
- /// is not the same as . The message is shown
- /// in test results.
- ///
- ///
- /// An array of parameters to use when formatting .
- ///
- ///
- /// Thrown if does not refer to the same object
- /// as .
- ///
- public static void AreSame(object expected, object actual, string message, params object[] parameters)
- {
- if (!ReferenceEquals(expected, actual))
- {
- string finalMessage = message;
-
- ValueType valExpected = expected as ValueType;
- if (valExpected != null)
- {
- ValueType valActual = actual as ValueType;
- if (valActual != null)
- {
- finalMessage = string.Format(
- CultureInfo.CurrentCulture,
- Resource.AreSameGivenValues,
- message == null ? string.Empty : ReplaceNulls(message));
- }
- }
-
- HandleFail("Assert.AreSame", finalMessage, parameters);
- }
- }
-
- ///
- /// Tests whether the specified objects refer to different objects and
- /// throws an exception if the two inputs refer to the same object.
- ///
- ///
- /// The first object to compare. This is the value the test expects not
- /// to match .
- ///
- ///
- /// The second object to compare. This is the value produced by the code under test.
- ///
- ///
- /// Thrown if refers to the same object
- /// as .
- ///
- public static void AreNotSame(object notExpected, object actual)
- {
- AreNotSame(notExpected, actual, string.Empty, null);
- }
-
- ///
- /// Tests whether the specified objects refer to different objects and
- /// throws an exception if the two inputs refer to the same object.
- ///
- ///
- /// The first object to compare. This is the value the test expects not
- /// to match .
- ///
- ///
- /// The second object to compare. This is the value produced by the code under test.
- ///
- ///
- /// The message to include in the exception when
- /// is the same as . The message is shown in
- /// test results.
- ///
- ///
- /// Thrown if refers to the same object
- /// as .
- ///
- public static void AreNotSame(object notExpected, object actual, string message)
- {
- AreNotSame(notExpected, actual, message, null);
- }
-
- ///
- /// Tests whether the specified objects refer to different objects and
- /// throws an exception if the two inputs refer to the same object.
- ///
- ///
- /// The first object to compare. This is the value the test expects not
- /// to match .
- ///
- ///
- /// The second object to compare. This is the value produced by the code under test.
- ///
- ///
- /// The message to include in the exception when
- /// is the same as . The message is shown in
- /// test results.
- ///
- ///
- /// An array of parameters to use when formatting .
- ///
- ///
- /// Thrown if refers to the same object
- /// as .
- ///
- public static void AreNotSame(object notExpected, object actual, string message, params object[] parameters)
- {
- if (ReferenceEquals(notExpected, actual))
- {
- HandleFail("Assert.AreNotSame", message, parameters);
- }
- }
-
- #endregion
-
- #region AreEqual
-
- ///
- /// Tests whether the specified values are equal and throws an exception
- /// if the two values are not equal. Different numeric types are treated
- /// as unequal even if the logical values are equal. 42L is not equal to 42.
- ///
- ///
- /// The type of values to compare.
- ///
- ///
- /// The first value to compare. This is the value the tests expects.
- ///
- ///
- /// The second value to compare. This is the value produced by the code under test.
- ///
- ///
- /// Thrown if is not equal to .
- ///
- public static void AreEqual(T expected, T actual)
- {
- AreEqual(expected, actual, string.Empty, null);
- }
-
- ///
- /// Tests whether the specified values are equal and throws an exception
- /// if the two values are not equal. Different numeric types are treated
- /// as unequal even if the logical values are equal. 42L is not equal to 42.
- ///
- ///
- /// The type of values to compare.
- ///
- ///
- /// The first value to compare. This is the value the tests expects.
- ///
- ///
- /// The second value to compare. This is the value produced by the code under test.
- ///
- ///
- /// The message to include in the exception when
- /// is not equal to . The message is shown in
- /// test results.
- ///
- ///
- /// Thrown if is not equal to
- /// .
- ///
- public static void AreEqual(T expected, T actual, string message)
- {
- AreEqual(expected, actual, message, null);
- }
-
- ///
- /// Tests whether the specified values are equal and throws an exception
- /// if the two values are not equal. Different numeric types are treated
- /// as unequal even if the logical values are equal. 42L is not equal to 42.
- ///
- ///
- /// The type of values to compare.
- ///
- ///
- /// The first value to compare. This is the value the tests expects.
- ///
- ///
- /// The second value to compare. This is the value produced by the code under test.
- ///
- ///
- /// The message to include in the exception when
- /// is not equal to . The message is shown in
- /// test results.
- ///
- ///
- /// An array of parameters to use when formatting .
- ///
- ///
- /// Thrown if is not equal to
- /// .
- ///
- public static void AreEqual(T expected, T actual, string message, params object[] parameters)
- {
- if (!object.Equals(expected, actual))
- {
- string finalMessage;
- if (actual != null && expected != null && !actual.GetType().Equals(expected.GetType()))
- {
- // This is for cases like: Assert.AreEqual(42L, 42) -> Expected: <42>, Actual: <42>
- finalMessage = string.Format(
- CultureInfo.CurrentCulture,
- Resource.AreEqualDifferentTypesFailMsg,
- message == null ? string.Empty : ReplaceNulls(message),
- ReplaceNulls(expected),
- expected.GetType().FullName,
- ReplaceNulls(actual),
- actual.GetType().FullName);
- }
- else
- {
- finalMessage = string.Format(
- CultureInfo.CurrentCulture,
- Resource.AreEqualFailMsg,
- message == null ? string.Empty : ReplaceNulls(message),
- ReplaceNulls(expected),
- ReplaceNulls(actual));
- }
-
- HandleFail("Assert.AreEqual", finalMessage, parameters);
- }
- }
-
- ///
- /// Tests whether the specified values are unequal and throws an exception
- /// if the two values are equal. Different numeric types are treated
- /// as unequal even if the logical values are equal. 42L is not equal to 42.
- ///
- ///
- /// The type of values to compare.
- ///
- ///
- /// The first value to compare. This is the value the test expects not
- /// to match .
- ///
- ///
- /// The second value to compare. This is the value produced by the code under test.
- ///
- ///
- /// Thrown if is equal to .
- ///
- public static void AreNotEqual(T notExpected, T actual)
- {
- AreNotEqual(notExpected, actual, string.Empty, null);
- }
-
- ///
- /// Tests whether the specified values are unequal and throws an exception
- /// if the two values are equal. Different numeric types are treated
- /// as unequal even if the logical values are equal. 42L is not equal to 42.
- ///
- ///
- /// The type of values to compare.
- ///
- ///
- /// The first value to compare. This is the value the test expects not
- /// to match .
- ///
- ///
- /// The second value to compare. This is the value produced by the code under test.
- ///
- ///
- /// The message to include in the exception when
- /// is equal to . The message is shown in
- /// test results.
- ///
- ///
- /// Thrown if is equal to .
- ///
- public static void AreNotEqual(T notExpected, T actual, string message)
- {
- AreNotEqual(notExpected, actual, message, null);
- }
-
- ///
- /// Tests whether the specified values are unequal and throws an exception
- /// if the two values are equal. Different numeric types are treated
- /// as unequal even if the logical values are equal. 42L is not equal to 42.
- ///
- ///
- /// The type of values to compare.
- ///
- ///
- /// The first value to compare. This is the value the test expects not
- /// to match .
- ///
- ///
- /// The second value to compare. This is the value produced by the code under test.
- ///
- ///
- /// The message to include in the exception when
- /// is equal to . The message is shown in
- /// test results.
- ///
- ///
- /// An array of parameters to use when formatting .
- ///
- ///
- /// Thrown if is equal to .
- ///
- public static void AreNotEqual(T notExpected, T actual, string message, params object[] parameters)
- {
- if (object.Equals(notExpected, actual))
- {
- string finalMessage = string.Format(
- CultureInfo.CurrentCulture,
- Resource.AreNotEqualFailMsg,
- message == null ? string.Empty : ReplaceNulls(message),
- ReplaceNulls(notExpected),
- ReplaceNulls(actual));
- HandleFail("Assert.AreNotEqual", finalMessage, parameters);
- }
- }
-
- ///
- /// Tests whether the specified objects are equal and throws an exception
- /// if the two objects are not equal. Different numeric types are treated
- /// as unequal even if the logical values are equal. 42L is not equal to 42.
- ///
- ///
- /// The first object to compare. This is the object the tests expects.
- ///
- ///
- /// The second object to compare. This is the object produced by the code under test.
- ///
- ///
- /// Thrown if is not equal to
- /// .
- ///
- public static void AreEqual(object expected, object actual)
- {
- AreEqual(expected, actual, string.Empty, null);
- }
-
- ///
- /// Tests whether the specified objects are equal and throws an exception
- /// if the two objects are not equal. Different numeric types are treated
- /// as unequal even if the logical values are equal. 42L is not equal to 42.
- ///
- ///
- /// The first object to compare. This is the object the tests expects.
- ///
- ///
- /// The second object to compare. This is the object produced by the code under test.
- ///
- ///
- /// The message to include in the exception when
- /// is not equal to . The message is shown in
- /// test results.
- ///
- ///
- /// Thrown if is not equal to
- /// .
- ///
- public static void AreEqual(object expected, object actual, string message)
- {
- AreEqual(expected, actual, message, null);
- }
-
- ///
- /// Tests whether the specified objects are equal and throws an exception
- /// if the two objects are not equal. Different numeric types are treated
- /// as unequal even if the logical values are equal. 42L is not equal to 42.
- ///
- ///
- /// The first object to compare. This is the object the tests expects.
- ///
- ///
- /// The second object to compare. This is the object produced by the code under test.
- ///
- ///
- /// The message to include in the exception when
- /// is not equal to . The message is shown in
- /// test results.
- ///
- ///
- /// An array of parameters to use when formatting .
- ///
- ///
- /// Thrown if is not equal to
- /// .
- ///
- public static void AreEqual(object expected, object actual, string message, params object[] parameters)
- {
- AreEqual