From 111a24e61fe4f1ce82ce1ae31e08e6a43dd3ce7b Mon Sep 17 00:00:00 2001 From: Daniel James Date: Fri, 22 Dec 2017 08:41:08 -0800 Subject: [PATCH] Removed Docker from build process and switched to use MSTest --- .gitignore | 3 - .travis.yml | 21 +- LICENSE.md | 21 -- README.md | 13 +- build.cake | 87 ------- build.ps1 | 228 ------------------ build.sh | 131 ---------- container.cake | 93 ------- .../CloudMQTT.Client.Tests.csproj | 10 +- .../WhenGettingUsers.cs | 11 +- src/CloudMQTT.Client/CloudMQTT.Client.csproj | 9 +- 11 files changed, 35 insertions(+), 592 deletions(-) delete mode 100644 LICENSE.md delete mode 100644 build.cake delete mode 100755 build.ps1 delete mode 100755 build.sh delete mode 100644 container.cake diff --git a/.gitignore b/.gitignore index fb0c05f..f646c32 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ bin obj -tools -tools-container -src/CloudMQTT.Client/AssemblyInfo.cs packages \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 6ecde02..f107dd1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,15 @@ language: csharp -os: linux # Ubuntu 14.04 +os: linux dist: trusty -group: edge sudo: required dotnet: 2.0.0 -services: - - docker - script: - - ./build.sh - -deploy: - provider: script - script: - - ./build.sh -t Publish - on: - branch: master + - dotnet restore + - dotnet build --configuration Release + - dotnet test src/CloudMQTT.Client.Tests + - "if [[ $TRAVIS_PULL_REQUEST == 'false' && $TRAVIS_TAG ]]; then + dotnet pack src/CloudMQTT.Client --configuration Release /p:Version=$TRAVIS_TAG; + dotnet nuget push src/CloudMQTT.Client/bin/Release/*.nupkg -s https://www.nuget.org/api/v2/package -k $NUGET_API_KEY; + fi" \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index a06e8c3..0000000 --- a/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Daniel James - -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/README.md b/README.md index d7c06a7..d24785d 100644 --- a/README.md +++ b/README.md @@ -23,18 +23,19 @@ var users = await _subject.GetUsers(); // Gets a list of MQTT users for the inst [![NuGet](https://img.shields.io/nuget/v/CloudMQTT.Client.svg)](https://www.nuget.org/packages/CloudMQTT.Client/) [![NuGet Pre Release](https://img.shields.io/nuget/vpre/CloudMQTT.Client.svg)](https://www.nuget.org/packages/CloudMQTT.Client/) -This project uses Cake and Docker to build the client. +Ensure you have [installed .NET Core](https://www.microsoft.com/net/core) -On macOS or Linux: +To build a local/development copy, run the following: ```bash -./build.sh +dotnet restore +dotnet build ``` -On Windows: +To run the tests, you'll need a CloudMQTT instance's username and password. If you don't have an instance, you can [sign up for free](https://www.cloudmqtt.com/plans.html). Note, the username and password are usually randomly-generated. (i.e., not the same as the credentials you log in to the CloudMQTT site with.) -```powershell -.\build.ps1 -Experimental +```bash +CLOUDMQTT_USER=ajeamalr CLOUDMQTT_PASSWORD=uwjamd3k_uma dotnet test ``` ## Code of Conduct diff --git a/build.cake b/build.cake deleted file mode 100644 index 247357f..0000000 --- a/build.cake +++ /dev/null @@ -1,87 +0,0 @@ -#addin nuget:?package=Cake.Git -#addin "Cake.Docker" -#load "container.cake" - -void RunTargetInContainer(string target, string arguments, params string[] includeEnvironmentVariables) { - var cwd = MakeAbsolute(Directory("./")); - var env = includeEnvironmentVariables - .Select(key => new { Key = key, Value = EnvironmentVariable(key) }) - .ToArray(); - - var missingEnv = env.Where(x => string.IsNullOrEmpty(x.Value)).ToList(); - if (missingEnv.Any()) { - throw new Exception($"The following environment variables are required to be set: {string.Join(", ", missingEnv.Select(x => x.Key))}"); - } - - var settings = new DockerContainerRunSettings - { - Volume = new string[] { $"{cwd}:/artifacts"}, - Workdir = "/artifacts", - Rm = true, - Env = env - .OrderBy(x => x.Key) - .Select((x) => $"{x.Key}=\"{x.Value}\"") - .ToArray(), - }; - - Information(string.Join(Environment.NewLine, settings.Env)); - - var command = $"cake -t {target} {arguments}"; - Information(command); - var buildBoxImage = "syncromatics/build-box"; - DockerPull(buildBoxImage); - DockerRun(settings, buildBoxImage, command); -} - -var version = ""; -var semVersion = ""; -Task("GetVersion") - .Does(() => - { - var repositoryPath = Directory("."); - var branch = GitBranchCurrent(repositoryPath).FriendlyName; - var prereleaseTag = Regex.Replace(branch, @"\W+", "-"); - var describe = GitDescribe(repositoryPath, GitDescribeStrategy.Tags); - - var isMaster = prereleaseTag == "master" || prereleaseTag == "-no-branch-"; - version = string.Join(".", describe.Split(new[] { '-' }, 3).Take(2)); - semVersion = version + (isMaster ? "" : $"-{prereleaseTag}"); - }); - -Task("AssignVersion") - .IsDependentOn("GetVersion") - .Does(() => { - CreateAssemblyInfo(File("./src/CloudMQTT.Client/AssemblyInfo.cs"), new AssemblyInfoSettings { - Product = "CloudMQTT.Client", - Version = version, - FileVersion = version, - InformationalVersion = semVersion, - Copyright = "Copyright 2017", - }); - - }); - - -Task("Build") - .IsDependentOn("AssignVersion") - .Does(() => RunTargetInContainer("ContainerBuild", "--verbosity Diagnostic")); - -Task("Package") - .Does(() => RunTargetInContainer("PackageNuget", "--verbosity Diagnostic")); - -Task("Publish") - .IsDependentOn("Package") - .Does(() => - { - var packageDir = Directory("packages"); - var package = GetFiles($"{packageDir}/*.nupkg").Single(); - - NuGetPush(package, new NuGetPushSettings - { - Source = "https://www.nuget.org/api/v2/package", - ApiKey = EnvironmentVariable("NUGET_API_KEY"), - }); - }); - -Task("Default").IsDependentOn("Build"); -RunTarget(Argument("target", "Build")); diff --git a/build.ps1 b/build.ps1 deleted file mode 100755 index 1d4173a..0000000 --- a/build.ps1 +++ /dev/null @@ -1,228 +0,0 @@ -########################################################################## -# This is the Cake bootstrapper script for PowerShell. -# This file was downloaded from https://github.com/cake-build/resources -# Feel free to change this file to fit your needs. -########################################################################## - -<# - -.SYNOPSIS -This is a Powershell script to bootstrap a Cake build. - -.DESCRIPTION -This Powershell script will download NuGet if missing, restore NuGet tools (including Cake) -and execute your Cake build script with the parameters you provide. - -.PARAMETER Script -The build script to execute. -.PARAMETER Target -The build script target to run. -.PARAMETER Configuration -The build configuration to use. -.PARAMETER Verbosity -Specifies the amount of information to be displayed. -.PARAMETER Experimental -Tells Cake to use the latest Roslyn release. -.PARAMETER WhatIf -Performs a dry run of the build script. -No tasks will be executed. -.PARAMETER Mono -Tells Cake to use the Mono scripting engine. -.PARAMETER SkipToolPackageRestore -Skips restoring of packages. -.PARAMETER ScriptArgs -Remaining arguments are added here. - -.LINK -https://cakebuild.net - -#> - -[CmdletBinding()] -Param( - [string]$Script = "build.cake", - [string]$Target = "Default", - [ValidateSet("Release", "Debug")] - [string]$Configuration = "Release", - [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] - [string]$Verbosity = "Verbose", - [switch]$Experimental, - [Alias("DryRun","Noop")] - [switch]$WhatIf, - [switch]$Mono, - [switch]$SkipToolPackageRestore, - [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] - [string[]]$ScriptArgs -) - -[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null -function MD5HashFile([string] $filePath) -{ - if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf)) - { - return $null - } - - [System.IO.Stream] $file = $null; - [System.Security.Cryptography.MD5] $md5 = $null; - try - { - $md5 = [System.Security.Cryptography.MD5]::Create() - $file = [System.IO.File]::OpenRead($filePath) - return [System.BitConverter]::ToString($md5.ComputeHash($file)) - } - finally - { - if ($file -ne $null) - { - $file.Dispose() - } - } -} - -Write-Host "Preparing to run build script..." - -if(!$PSScriptRoot){ - $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent -} - -$TOOLS_DIR = Join-Path $PSScriptRoot "tools" -$ADDINS_DIR = Join-Path $TOOLS_DIR "Addins" -$MODULES_DIR = Join-Path $TOOLS_DIR "Modules" -$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe" -$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe" -$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config" -$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum" -$ADDINS_PACKAGES_CONFIG = Join-Path $ADDINS_DIR "packages.config" -$MODULES_PACKAGES_CONFIG = Join-Path $MODULES_DIR "packages.config" - -# Should we use mono? -$UseMono = ""; -if($Mono.IsPresent) { - Write-Verbose -Message "Using the Mono based scripting engine." - $UseMono = "-mono" -} - -# Should we use the new Roslyn? -$UseExperimental = ""; -if($Experimental.IsPresent -and !($Mono.IsPresent)) { - Write-Verbose -Message "Using experimental version of Roslyn." - $UseExperimental = "-experimental" -} - -# Is this a dry run? -$UseDryRun = ""; -if($WhatIf.IsPresent) { - $UseDryRun = "-dryrun" -} - -# Make sure tools folder exists -if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) { - Write-Verbose -Message "Creating tools directory..." - New-Item -Path $TOOLS_DIR -Type directory | out-null -} - -# Make sure that packages.config exist. -if (!(Test-Path $PACKAGES_CONFIG)) { - Write-Verbose -Message "Downloading packages.config..." - try { (New-Object System.Net.WebClient).DownloadFile("https://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch { - Throw "Could not download packages.config." - } -} - -# Try find NuGet.exe in path if not exists -if (!(Test-Path $NUGET_EXE)) { - Write-Verbose -Message "Trying to find nuget.exe in PATH..." - $existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_ -PathType Container) } - $NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1 - if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) { - Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)." - $NUGET_EXE = $NUGET_EXE_IN_PATH.FullName - } -} - -# Try download NuGet.exe if not exists -if (!(Test-Path $NUGET_EXE)) { - Write-Verbose -Message "Downloading NuGet.exe..." - try { - (New-Object System.Net.WebClient).DownloadFile($NUGET_URL, $NUGET_EXE) - } catch { - Throw "Could not download NuGet.exe." - } -} - -# Save nuget.exe path to environment to be available to child processed -$ENV:NUGET_EXE = $NUGET_EXE - -# Restore tools from NuGet? -if(-Not $SkipToolPackageRestore.IsPresent) { - Push-Location - Set-Location $TOOLS_DIR - - # Check for changes in packages.config and remove installed tools if true. - [string] $md5Hash = MD5HashFile($PACKAGES_CONFIG) - if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or - ($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) { - Write-Verbose -Message "Missing or changed package.config hash..." - Remove-Item * -Recurse -Exclude packages.config,nuget.exe - } - - Write-Verbose -Message "Restoring tools from NuGet..." - $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occured while restoring NuGet tools." - } - else - { - $md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII" - } - Write-Verbose -Message ($NuGetOutput | out-string) - - Pop-Location -} - -# Restore addins from NuGet -if (Test-Path $ADDINS_PACKAGES_CONFIG) { - Push-Location - Set-Location $ADDINS_DIR - - Write-Verbose -Message "Restoring addins from NuGet..." - $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$ADDINS_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occured while restoring NuGet addins." - } - - Write-Verbose -Message ($NuGetOutput | out-string) - - Pop-Location -} - -# Restore modules from NuGet -if (Test-Path $MODULES_PACKAGES_CONFIG) { - Push-Location - Set-Location $MODULES_DIR - - Write-Verbose -Message "Restoring modules from NuGet..." - $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$MODULES_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occured while restoring NuGet modules." - } - - Write-Verbose -Message ($NuGetOutput | out-string) - - Pop-Location -} - -# Make sure that Cake has been installed. -if (!(Test-Path $CAKE_EXE)) { - Throw "Could not find Cake.exe at $CAKE_EXE" -} - -# Start Cake -Write-Host "Running build script..." -Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs" -exit $LASTEXITCODE diff --git a/build.sh b/build.sh deleted file mode 100755 index 749511a..0000000 --- a/build.sh +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/env bash - -########################################################################## -# This is the Cake bootstrapper script for Linux and OS X. -# This file was downloaded from https://github.com/cake-build/resources -# Feel free to change this file to fit your needs. -########################################################################## - -# Define directories. -SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -TOOLS_DIR=$SCRIPT_DIR/tools-container -ADDINS_DIR=$TOOLS_DIR/Addins -MODULES_DIR=$TOOLS_DIR/Modules -NUGET_EXE=$TOOLS_DIR/nuget.exe -CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe -PACKAGES_CONFIG=$TOOLS_DIR/packages.config -PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum -ADDINS_PACKAGES_CONFIG=$ADDINS_DIR/packages.config -MODULES_PACKAGES_CONFIG=$MODULES_DIR/packages.config - -# Define md5sum or md5 depending on Linux/OSX -MD5_EXE= -if [[ "$(uname -s)" == "Darwin" ]]; then - MD5_EXE="md5 -r" -else - MD5_EXE="md5sum" -fi - -# Define default arguments. -SCRIPT="build.cake" -TARGET="Default" -CONFIGURATION="Release" -VERBOSITY="verbose" -DRYRUN= -SHOW_VERSION=false -SCRIPT_ARGUMENTS=() - -# Parse arguments. -for i in "$@"; do - case $1 in - -s|--script) SCRIPT="$2"; shift ;; - -t|--target) TARGET="$2"; shift ;; - -c|--configuration) CONFIGURATION="$2"; shift ;; - -v|--verbosity) VERBOSITY="$2"; shift ;; - -d|--dryrun) DRYRUN="-dryrun" ;; - --version) SHOW_VERSION=true ;; - --) shift; SCRIPT_ARGUMENTS+=("$@"); break ;; - *) SCRIPT_ARGUMENTS+=("$1") ;; - esac - shift -done - -# Make sure the tools folder exist. -if [ ! -d "$TOOLS_DIR" ]; then - mkdir "$TOOLS_DIR" -fi - -# Make sure that packages.config exist. -if [ ! -f "$TOOLS_DIR/packages.config" ]; then - echo "Downloading packages.config..." - curl -Lsfo "$TOOLS_DIR/packages.config" https://cakebuild.net/download/bootstrapper/packages - if [ $? -ne 0 ]; then - echo "An error occured while downloading packages.config." - exit 1 - fi -fi - -# Download NuGet if it does not exist. -if [ ! -f "$NUGET_EXE" ]; then - echo "Downloading NuGet..." - curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe - if [ $? -ne 0 ]; then - echo "An error occured while downloading nuget.exe." - exit 1 - fi -fi - -# Restore tools from NuGet. -pushd "$TOOLS_DIR" >/dev/null -if [ ! -f "$PACKAGES_CONFIG_MD5" ] || [ "$( cat "$PACKAGES_CONFIG_MD5" | sed 's/\r$//' )" != "$( $MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' )" ]; then - find . -type d ! -name . | xargs rm -rf -fi - -mono "$NUGET_EXE" install -ExcludeVersion -if [ $? -ne 0 ]; then - echo "Could not restore NuGet tools." - exit 1 -fi - -$MD5_EXE "$PACKAGES_CONFIG" | awk '{ print $1 }' >| "$PACKAGES_CONFIG_MD5" - -popd >/dev/null - -# Restore addins from NuGet. -if [ -f "$ADDINS_PACKAGES_CONFIG" ]; then - pushd "$ADDINS_DIR" >/dev/null - - mono "$NUGET_EXE" install -ExcludeVersion - if [ $? -ne 0 ]; then - echo "Could not restore NuGet addins." - exit 1 - fi - - popd >/dev/null -fi - -# Restore modules from NuGet. -if [ -f "$MODULES_PACKAGES_CONFIG" ]; then - pushd "$MODULES_DIR" >/dev/null - - mono "$NUGET_EXE" install -ExcludeVersion - if [ $? -ne 0 ]; then - echo "Could not restore NuGet modules." - exit 1 - fi - - popd >/dev/null -fi - -# Make sure that Cake has been installed. -if [ ! -f "$CAKE_EXE" ]; then - echo "Could not find Cake.exe at '$CAKE_EXE'." - exit 1 -fi - -# Start Cake -if $SHOW_VERSION; then - exec mono "$CAKE_EXE" -version -else - exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -configuration=$CONFIGURATION -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" -fi diff --git a/container.cake b/container.cake deleted file mode 100644 index b7ac437..0000000 --- a/container.cake +++ /dev/null @@ -1,93 +0,0 @@ -#addin nuget:?package=Cake.Git -#tool "nuget:?package=xunit.runner.console" -using System.Text.RegularExpressions; - -var configuration = Argument("configuration", "Release"); -var outputDirectory = Directory("packages"); - -Task("Clean") - .Does(() => - { - CleanDirectories(GetDirectories("./src/**/bin") - .Concat(GetDirectories("./src/**/obj"))); - }); - -Task("Restore") - .IsDependentOn("Clean") - .Does(() => - { - DotNetCoreRestore(); - }); - -Task("Compile") - .IsDependentOn("Restore") - .Does(() => - { - var buildSettings = new ProcessSettings - { - Arguments = $"/property:Configuration={configuration}", - }; - - using(var process = StartAndReturnProcess("msbuild", buildSettings)) - { - process.WaitForExit(); - var exitCode = process.GetExitCode(); - if(exitCode != 0) - throw new Exception("Build Failed."); - } - }); - -Task("ResolvePermissions") - .IsDependentOn("Compile") - .Does(() => { - var chmodSettings = new ProcessSettings - { - Arguments = $"-c 'chmod -R 777 ./src'", - }; - - using(var process = StartAndReturnProcess("bash", chmodSettings)) - { - process.WaitForExit(); - var exitCode = process.GetExitCode(); - if(exitCode != 0) - throw new Exception("Resolve permissions failed."); - } - }); - -Task("Test") - .IsDependentOn("ResolvePermissions") - .Does(() => - { - Warning("Tests disabled because Mono's System.Net.Http isn't fully baked"); - // XUnit2(GetFiles($"./src/**/bin/{configuration}/**/*.Tests.dll"), new XUnit2Settings - // { - // Parallelism = ParallelismOption.Assemblies, - // }); - }); - -Task("ContainerBuild") - .IsDependentOn("Test"); - -Task("CleanPackages") - .Does(() => { - CleanDirectory(outputDirectory); - }); - -Task("PackageNuget") - .IsDependentOn("CleanPackages") - .IsDependentOn("AssignVersion") - .IsDependentOn("ContainerBuild") - .Does(() => - { - var assemblyInfo = ParseAssemblyInfo(File("./src/CloudMQTT.Client/AssemblyInfo.cs")); - var versionInfo = assemblyInfo.AssemblyInformationalVersion; - - var packageSettings = new DotNetCorePackSettings - { - Configuration = configuration, - OutputDirectory = outputDirectory, - ArgumentCustomization = args => args.Append($"/p:Version={versionInfo}") - }; - - DotNetCorePack(File("./src/CloudMQTT.Client/CloudMQTT.Client.csproj"), packageSettings); - }); diff --git a/src/CloudMQTT.Client.Tests/CloudMQTT.Client.Tests.csproj b/src/CloudMQTT.Client.Tests/CloudMQTT.Client.Tests.csproj index 2dd7e9c..dcefafb 100644 --- a/src/CloudMQTT.Client.Tests/CloudMQTT.Client.Tests.csproj +++ b/src/CloudMQTT.Client.Tests/CloudMQTT.Client.Tests.csproj @@ -1,13 +1,13 @@  - netcoreapp1.1 + netcoreapp2.0 false - - - - + + + + diff --git a/src/CloudMQTT.Client.Tests/WhenGettingUsers.cs b/src/CloudMQTT.Client.Tests/WhenGettingUsers.cs index 03db166..661bc37 100644 --- a/src/CloudMQTT.Client.Tests/WhenGettingUsers.cs +++ b/src/CloudMQTT.Client.Tests/WhenGettingUsers.cs @@ -8,21 +8,24 @@ using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using RestEase; -using Xunit; +using Microsoft.VisualStudio.TestTools.UnitTesting; namespace CloudMQTT.Client.Tests { + [TestClass] public class WhenGettingUsers { - private readonly ICloudMqttApi _subject; - public WhenGettingUsers() + private ICloudMqttApi _subject; + + [TestInitialize] + public void SetUp() { var username = Environment.GetEnvironmentVariable("CLOUDMQTT_USER"); var password = Environment.GetEnvironmentVariable("CLOUDMQTT_PASSWORD"); _subject = CloudMqttApi.GetInstance(username, password); } - [Fact] + [TestMethod] public async Task ItShouldCreateAndDeleteUserSuccessfully() { var expectedUser = new NewUser diff --git a/src/CloudMQTT.Client/CloudMQTT.Client.csproj b/src/CloudMQTT.Client/CloudMQTT.Client.csproj index 2fb363f..929c563 100644 --- a/src/CloudMQTT.Client/CloudMQTT.Client.csproj +++ b/src/CloudMQTT.Client/CloudMQTT.Client.csproj @@ -1,10 +1,17 @@  netstandard1.1 - false + true + false Daniel James + 2017 Daniel James + CloudMQTT.Client + Simple client to interact with the CloudMQTT management HTTP API https://github.com/thzinc/CloudMQTT/blob/master/LICENSE.md https://github.com/thzinc/CloudMQTT + https://github.com/thzinc/CloudMQTT + c#,csharp,cloudmqtt,client + 0.0.0