diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8070df4..ad8b228 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,28 +11,17 @@ on: jobs: build: - runs-on: windows-latest + runs-on: ubuntu-latest name: Dotnet build steps: - - uses: actions/checkout@v2 - - run: | - git fetch --prune --unshallow - - run: | - git branch master origin/master - if: github.event_name != 'push' || (github.event_name == 'push' && github.ref != 'refs/heads/master') - - name: Setup dotnet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: "2.2.103" + - name: Checkout + uses: actions/checkout@v1 - name: Build - run: .\build.ps1 - shell: pwsh - id: build - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NUGET_TOKEN: ${{ secrets.NugetKey }} - - name: Add artifacts - uses: actions/upload-artifact@v1 - with: - name: ${{ steps.build.outputs.nupkg_name }} - path: ${{ steps.build.outputs.nupkg }} + run: dotnet build -c Release --nologo + - name: Run Unit Tests + run: dotnet test -c Release --no-build --nologo + - name: Push to Feedz.io + run: dotnet nuget push "src/Slack.Webhooks/bin/Release/*.nupkg" --source "https://f.feedz.io/mrb0nj/slack-webhooks/nuget/index.json" -k ${{ secrets.FEEDZIO_TOKEN }} -n true + if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')) +env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 99c0218..d0a2e74 100644 --- a/.gitignore +++ b/.gitignore @@ -110,5 +110,6 @@ Generated_Code #added for RIA/Silverlight projects _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML -/src/.vs/Slack.Webhooks/v15/Server/sqlite3 -/.vs +**/.vscode +**/.vs +.idea \ No newline at end of file diff --git a/GitVersion.yml b/GitVersion.yml deleted file mode 100644 index ebdfba1..0000000 --- a/GitVersion.yml +++ /dev/null @@ -1,6 +0,0 @@ -assembly-versioning-scheme: MajorMinorPatch -mode: ContinuousDeployment -branches: {} -ignore: - sha: [] -merge-message-formats: {} diff --git a/README.md b/README.md index 5f6bef9..ed71f6f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Slack.Webhooks ![Continuous Stuff](https://github.com/mrb0nj/Slack.Webhooks/workflows/Continuous%20Stuff/badge.svg?branch=master) [![NuGet Version](http://img.shields.io/nuget/v/Slack.Webhooks.svg?style=flat)](https://www.nuget.org/packages/Slack.Webhooks/) +# Slack.Webhooks ![Continuous Stuff](https://github.com/mrb0nj/Slack.Webhooks/workflows/Continuous%20Stuff/badge.svg?branch=master) [![NuGet Version](http://img.shields.io/nuget/v/Slack.Webhooks.svg?style=flat)](https://www.nuget.org/packages/Slack.Webhooks/) [![feedz.io](https://img.shields.io/badge/endpoint.svg?url=https%3A%2F%2Ff.feedz.io%2Fmrb0nj%2Fslack-webhooks%2Fshield%2FSlack.Webhooks%2Flatest&label=Slack.Webhooks)](https://f.feedz.io/mrb0nj/slack-webhooks/packages/Slack.Webhooks/latest/download) Even simpler integration with Slack's Incoming/Outgoing webhooks API for .net diff --git a/src/Slack.Webhooks.sln b/Slack.Webhooks.sln similarity index 86% rename from src/Slack.Webhooks.sln rename to Slack.Webhooks.sln index 3fe46a8..427d461 100644 --- a/src/Slack.Webhooks.sln +++ b/Slack.Webhooks.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26403.7 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Slack.Webhooks", "Slack.Webhooks\Slack.Webhooks.csproj", "{53751B1B-A63E-4E4F-988C-BC783E68B15F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Slack.Webhooks", "src\Slack.Webhooks\Slack.Webhooks.csproj", "{53751B1B-A63E-4E4F-988C-BC783E68B15F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Slack.Webhooks.Tests", "Slack.Webhooks.Tests\Slack.Webhooks.Tests.csproj", "{5ABDDE87-A87C-495C-A5CE-01C23C9E2F62}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Slack.Webhooks.Tests", "src\Slack.Webhooks.Tests\Slack.Webhooks.Tests.csproj", "{5ABDDE87-A87C-495C-A5CE-01C23C9E2F62}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/build.cake b/build.cake deleted file mode 100644 index 804d0f3..0000000 --- a/build.cake +++ /dev/null @@ -1,188 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// ARGUMENTS -/////////////////////////////////////////////////////////////////////////////// - -var target = Argument("target", "Default"); -var configuration = Argument("configuration", "Release"); - -/////////////////////////////////////////////////////////////////////////////// -// TOOLS / ADDINS -/////////////////////////////////////////////////////////////////////////////// - -#tool "nuget:?package=xunit.runner.console&version=2.3.1" -#tool "nuget:?package=GitVersion.CommandLine&version=5.0.1" -#tool "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2019.2.3" -#addin "nuget:?package=Cake.Incubator&version=5.1.0" -#addin "nuget:?package=Cake.Coverlet&version=2.3.4" - -/////////////////////////////////////////////////////////////////////////////// -// TASKS -/////////////////////////////////////////////////////////////////////////////// - -var isGitHubAction = !string.IsNullOrWhiteSpace(EnvironmentVariable("GITHUB_ACTION")); -var githubEventName = EnvironmentVariable("GITHUB_EVENT_NAME"); -var githubRef = EnvironmentVariable("GITHUB_REF"); -var githubBaseRef = EnvironmentVariable("GITHUB_BASE_REF"); -var isPullRequest = githubEventName == "pull_request"; -var isTag = githubEventName == "push" && githubRef.StartsWith("refs/tags/v"); - -Information($"EventName: {githubEventName}, Ref: {githubRef}, BaseRef: {githubBaseRef}, IsTag: {isTag}, IsGithubAction: {isGitHubAction}"); - -GitVersion gitVersion = null; -Task("Default") - .IsDependentOn("Build") - .IsDependentOn("Test") - .IsDependentOn("Deploy"); - -Task("Version") - .Does(() => -{ - gitVersion = GitVersion(new GitVersionSettings { - UpdateAssemblyInfo = true - }); - Information(gitVersion.FullSemVer); -}); - -Task("Clean") - .Does(() => -{ - var settings = new DeleteDirectorySettings { Recursive = true }; - DeleteDirectories(GetDirectories($"src/**/bin/{configuration}/"), settings); - DeleteDirectories(GetDirectories($"src/**/obj/{configuration}/"), settings); -}); - -Task("Restore") - .Does(() => -{ - NuGetRestore("src/Slack.Webhooks.sln", new NuGetRestoreSettings { - Verbosity = NuGetVerbosity.Quiet - }); -}); - -Task("Build") - .IsDependentOn("Version") - .IsDependentOn("Clean") - .IsDependentOn("Restore") - .Does(() => -{ - DotNetCoreBuild("src/Slack.Webhooks.sln", new DotNetCoreBuildSettings - { - Configuration = configuration - }); -}); - -Task("Pack") - .IsDependentOn("Build") - .Does(() => -{ - var nuGetPackSettings = new NuGetPackSettings { - Version = gitVersion.NuGetVersionV2, - OutputDirectory = "./artifacts" - }; - - NuGetPack("src/Slack.Webhooks/Slack.Webhooks.nuspec", nuGetPackSettings); - - if(isGitHubAction) - { - var packageName = $"Slack.Webhooks.{gitVersion.NuGetVersionV2}"; - Information($"##[set-output name=nupkg_name;]{packageName}"); - Information($"##[set-output name=nupkg;]artifacts/{packageName}.nupkg"); - } -}); - -Task("Deploy") - .IsDependentOn("DeployGPR") - .IsDependentOn("DeployNuGet"); - -Task("DeployGPR") - .IsDependentOn("Pack") - .Does(() => -{ - if(isGitHubAction && !isPullRequest) - { - Information($"DeployGPR. IsGitHubAction: {isGitHubAction}, IsPullRequest: {isPullRequest}"); - var settings = new NuGetSourcesSettings - { - UserName = "mrb0nj", - Password = EnvironmentVariable("GITHUB_TOKEN"), - IsSensitiveSource = true, - Verbosity = NuGetVerbosity.Detailed - }; - NuGetAddSource("GPR", "https://nuget.pkg.github.com/mrb0nj/index.json", settings); - NuGetPush($"artifacts/Slack.Webhooks.{gitVersion.NuGetVersionV2}.nupkg", new NuGetPushSettings { - Source = "GPR" - }); - } - else - { - Information($"Skipping DeployGPR. IsGitHubAction: {isGitHubAction}, IsPullRequest: {isPullRequest}"); - } -}); - -Task("DeployNuGet") - .IsDependentOn("Pack") - .Does(() => -{ - if(isGitHubAction && isTag) - { - Information($"DeployNuget. IsGitHubAction: {isGitHubAction}, IsTag: {isTag}"); - var settings = new NuGetPushSettings - { - Source = "https://api.nuget.org/v3/index.json", - ApiKey = EnvironmentVariable("NUGET_TOKEN") - }; - NuGetPush($"artifacts/Slack.Webhooks.{gitVersion.NuGetVersionV2}.nupkg", settings); - } - else - { - Information($"Skipping DeployNuget. IsGitHubAction: {isGitHubAction}, IsTag: {isTag}"); - } -}); - -Task("Test") - .IsDependentOn("TestFramework") - .IsDependentOn("TestCore"); - -Task("TestFramework") - .IsDependentOn("Build") - .Does(() => -{ - var testAssemblies = GetFiles($"./src/**/bin/{configuration}/net45/*.Tests.dll"); - XUnit2(testAssemblies, new XUnit2Settings { - Parallelism = ParallelismOption.All, - NoAppDomain = true - }); -}); - -Task("TestCore") - .IsDependentOn("Build") - .Does(() => -{ - var coverletSettings = new CoverletSettings { - CollectCoverage = true, - CoverletOutputFormat = CoverletOutputFormat.opencover, - CoverletOutputDirectory = Directory(@".\artifacts\"), - CoverletOutputName = $"coverlet-output" - }; - DotNetCoreTest("./src/Slack.Webhooks.Tests/Slack.Webhooks.Tests.csproj", new DotNetCoreTestSettings - { - NoBuild = true, - Framework = "netcoreapp2", - Configuration = configuration - }, coverletSettings); -}); - -Task("ReSharper") - .Does(() => -{ - DupFinder("src/Slack.Webhooks.sln", new DupFinderSettings { - OutputFile = "artifacts/dupfinder-output.xml" - }); - InspectCode("src/Slack.Webhooks.sln", new InspectCodeSettings { - SolutionWideAnalysis = true, - OutputFile = "artifacts/inspectcode-output.xml", - ThrowExceptionOnFindingViolations = true - }); -}); - -RunTarget(target); \ No newline at end of file diff --git a/build.ps1 b/build.ps1 deleted file mode 100644 index a336e29..0000000 --- a/build.ps1 +++ /dev/null @@ -1,256 +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 ShowDescription -Shows description about tasks. -.PARAMETER DryRun -Performs a dry run. -.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, - [string]$Configuration, - [ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")] - [string]$Verbosity, - [switch]$ShowDescription, - [Alias("WhatIf", "Noop")] - [switch]$DryRun, - [switch]$SkipToolPackageRestore, - [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] - [string[]]$ScriptArgs -) - -# Attempt to set highest encryption available for SecurityProtocol. -# PowerShell will not set this by default (until maybe .NET 4.6.x). This -# will typically produce a message for PowerShell v2 (just an info -# message though) -try { - # Set TLS 1.2 (3072), then TLS 1.1 (768), then TLS 1.0 (192), finally SSL 3.0 (48) - # Use integers because the enumeration values for TLS 1.2 and TLS 1.1 won't - # exist in .NET 4.0, even though they are addressable if .NET 4.5+ is - # installed (.NET 4.5 is an in-place upgrade). - # PowerShell Core already has support for TLS 1.2 so we can skip this if running in that. - if (-not $IsCoreCLR) { - [System.Net.ServicePointManager]::SecurityProtocol = 3072 -bor 768 -bor 192 -bor 48 - } - } catch { - Write-Output 'Unable to set PowerShell to use TLS 1.2 and TLS 1.1 due to old .NET Framework installed. If you see underlying connection closed or trust errors, you may need to upgrade to .NET Framework 4.5+ and PowerShell v3' - } - -[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() - } - } -} - -function GetProxyEnabledWebClient -{ - $wc = New-Object System.Net.WebClient - $proxy = [System.Net.WebRequest]::GetSystemWebProxy() - $proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials - $wc.Proxy = $proxy - return $wc -} - -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" - -# 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 { - $wc = GetProxyEnabledWebClient - $wc.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 { - $wc = GetProxyEnabledWebClient - $wc.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 -$env:NUGET_EXE_INVOCATION = if ($IsLinux -or $IsMacOS) { - "mono `"$NUGET_EXE`"" -} else { - "`"$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..." - Get-ChildItem -Exclude packages.config,nuget.exe,Cake.Bakery | - Remove-Item -Recurse -Force - } - - Write-Verbose -Message "Restoring tools from NuGet..." - - $NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occurred 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 "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$ADDINS_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occurred 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 "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$MODULES_DIR`"" - - if ($LASTEXITCODE -ne 0) { - Throw "An error occurred 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" -} - -$CAKE_EXE_INVOCATION = if ($IsLinux -or $IsMacOS) { - "mono `"$CAKE_EXE`"" -} else { - "`"$CAKE_EXE`"" -} - - # Build an array (not a string) of Cake arguments to be joined later -$cakeArguments = @() -if ($Script) { $cakeArguments += "`"$Script`"" } -if ($Target) { $cakeArguments += "-target=`"$Target`"" } -if ($Configuration) { $cakeArguments += "-configuration=$Configuration" } -if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" } -if ($ShowDescription) { $cakeArguments += "-showdescription" } -if ($DryRun) { $cakeArguments += "-dryrun" } -$cakeArguments += $ScriptArgs - -# Start Cake -Write-Host "Running build script..." -Invoke-Expression "& $CAKE_EXE_INVOCATION $($cakeArguments -join " ")" -exit $LASTEXITCODE diff --git a/build.sh b/build.sh deleted file mode 100644 index b9e1252..0000000 --- a/build.sh +++ /dev/null @@ -1,117 +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 -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" -CAKE_ARGUMENTS=() - -# Parse arguments. -for i in "$@"; do - case $1 in - -s|--script) SCRIPT="$2"; shift ;; - --) shift; CAKE_ARGUMENTS+=("$@"); break ;; - *) CAKE_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 occurred 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 occurred 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 . ! -name 'Cake.Bakery' | 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 -exec mono "$CAKE_EXE" $SCRIPT "${CAKE_ARGUMENTS[@]}" diff --git a/cake.config b/cake.config deleted file mode 100644 index 8089cd4..0000000 --- a/cake.config +++ /dev/null @@ -1,15 +0,0 @@ -; This is the default configuration file for Cake. -; This file was downloaded from https://github.com/cake-build/resources - -[Nuget] -Source=https://api.nuget.org/v3/index.json -UseInProcessClient=true -LoadDependencies=false - -[Paths] -Tools=./tools -Addins=./tools/Addins -Modules=./tools/Modules - -[Settings] -SkipVerification=false diff --git a/src/Slack.Webhooks.Tests/ActionsBlockFixtures.cs b/src/Slack.Webhooks.Tests/ActionsBlockFixtures.cs index 9b6b3d4..3aa7ad7 100644 --- a/src/Slack.Webhooks.Tests/ActionsBlockFixtures.cs +++ b/src/Slack.Webhooks.Tests/ActionsBlockFixtures.cs @@ -1,7 +1,9 @@ using System.Collections.Generic; using FluentAssertions; using Slack.Webhooks.Blocks; +using Slack.Webhooks.Classes; using Slack.Webhooks.Elements; +using Slack.Webhooks.Helpers; using Slack.Webhooks.Interfaces; using Xunit; @@ -13,22 +15,22 @@ public class ActionsBlockFixtures public void ShouldSerializeActionElements() { // arrange - var elementList = new List - { - new Button(), - new SelectChannels(), - new SelectConversations(), - new SelectExternal(), - new SelectStatic(), + var elementList = new List + { + new Button(), + new SelectChannels(), + new SelectConversations(), + new SelectExternal(), + new SelectStatic(), new SelectUsers(), new Overflow(), new DatePicker() }; - var actions = new Actions { Elements = elementList }; + var actions = new ActionsBlock { Elements = elementList }; // act - var elementListPayload = SlackClient.SerializeObject(elementList); - var payload = SlackClient.SerializeObject(actions); + var elementListPayload = SerializationHelper.Serialize(elementList); + var payload = SerializationHelper.Serialize(actions); // assert payload.Should().Contain($"\"elements\":{elementListPayload}"); diff --git a/src/Slack.Webhooks.Tests/BlockFixtures.cs b/src/Slack.Webhooks.Tests/BlockFixtures.cs index 64ef8b8..9869d05 100644 --- a/src/Slack.Webhooks.Tests/BlockFixtures.cs +++ b/src/Slack.Webhooks.Tests/BlockFixtures.cs @@ -2,6 +2,8 @@ using FluentAssertions; using Newtonsoft.Json; using Slack.Webhooks.Blocks; +using Slack.Webhooks.Classes; +using Slack.Webhooks.Helpers; using Xunit; namespace Slack.Webhooks.Tests @@ -10,10 +12,10 @@ public class BlockFixtures { [Theory] [MemberData(nameof(GetData))] - public void ShouldHaveBlockTypeAndBlockId(Block block, string expectedType, string expectedBlockId) + public void ShouldHaveBlockTypeAndBlockId(BlockBase blockBase, string expectedType, string expectedBlockId) { // arrange/act - var payload = SlackClient.SerializeObject(block); + var payload = SerializationHelper.Serialize(blockBase); // assert payload.Should().Contain($"\"type\":\"{expectedType}\""); @@ -24,13 +26,13 @@ public static IEnumerable GetData() { return new List { - new object[] { new Divider {BlockId = "0001"}, "divider", "0001" }, - new object[] { new Image {BlockId = "0002"}, "image", "0002" }, - new object[] { new Section {BlockId = "0003"}, "section", "0003" }, - new object[] { new Context {BlockId = "0004"}, "context", "0004" }, - new object[] { new File {BlockId = "0005"}, "file", "0005" }, - new object[] { new Actions {BlockId = "0006"}, "actions", "0006" }, - new object[] { new Input {BlockId = "0007"}, "input", "0007" } + new object[] { new DividerBlock {BlockId = "0001"}, "divider", "0001" }, + new object[] { new ImageBlock {BlockId = "0002"}, "image", "0002" }, + new object[] { new SectionBlock {BlockId = "0003"}, "section", "0003" }, + new object[] { new ContextBlock {BlockId = "0004"}, "context", "0004" }, + new object[] { new FileBlock {BlockId = "0005"}, "file", "0005" }, + new object[] { new ActionsBlock {BlockId = "0006"}, "actions", "0006" }, + new object[] { new InputBlock {BlockId = "0007"}, "input", "0007" } }; } } diff --git a/src/Slack.Webhooks.Tests/ButtonElementFixtures.cs b/src/Slack.Webhooks.Tests/ButtonElementFixtures.cs index 8652563..f9136f6 100644 --- a/src/Slack.Webhooks.Tests/ButtonElementFixtures.cs +++ b/src/Slack.Webhooks.Tests/ButtonElementFixtures.cs @@ -1,5 +1,7 @@ using FluentAssertions; +using Slack.Webhooks.Classes; using Slack.Webhooks.Elements; +using Slack.Webhooks.Helpers; using Xunit; namespace Slack.Webhooks.Tests @@ -13,7 +15,7 @@ public void ShouldSerializeType() var button = new Button(); // act - var payload = SlackClient.SerializeObject(button); + var payload = SerializationHelper.Serialize(button); // assert payload.Should().Contain("\"type\":\"button\""); @@ -23,10 +25,10 @@ public void ShouldSerializeType() public void ShouldSerializeText() { // arrange - var button = new Button { Text = new TextObject { Text = "Test Text" }}; + var button = new Button { Text = new TextObject { Text = "Test Text" } }; // act - var payload = SlackClient.SerializeObject(button); + var payload = SerializationHelper.Serialize(button); // assert payload.Should().Contain("\"text\":{\"type\":\"plain_text\""); @@ -39,7 +41,7 @@ public void ShouldSerializeActionId() var button = new Button { ActionId = "Action123" }; // act - var payload = SlackClient.SerializeObject(button); + var payload = SerializationHelper.Serialize(button); // assert payload.Should().Contain("\"action_id\":\"Action123\""); @@ -52,7 +54,7 @@ public void ShouldSerializeUrl() var button = new Button { Url = "http://someurl.com" }; // act - var payload = SlackClient.SerializeObject(button); + var payload = SerializationHelper.Serialize(button); // assert payload.Should().Contain("\"url\":\"http://someurl.com\""); @@ -65,7 +67,7 @@ public void ShouldSerializeValue() var button = new Button { Value = "Value123" }; // act - var payload = SlackClient.SerializeObject(button); + var payload = SerializationHelper.Serialize(button); // assert payload.Should().Contain("\"value\":\"Value123\""); @@ -78,7 +80,7 @@ public void ShouldSerializeStyle() var button = new Button { Style = "Style123" }; // act - var payload = SlackClient.SerializeObject(button); + var payload = SerializationHelper.Serialize(button); // assert payload.Should().Contain("\"style\":\"Style123\""); @@ -92,8 +94,8 @@ public void ShouldSerializeConfirm() var button = new Button { Confirm = confirm }; // act - var confirmPayload = SlackClient.SerializeObject(confirm); - var payload = SlackClient.SerializeObject(button); + var confirmPayload = SerializationHelper.Serialize(confirm); + var payload = SerializationHelper.Serialize(button); // assert payload.Should().Contain($"\"confirm\":{confirmPayload}"); diff --git a/src/Slack.Webhooks.Tests/ConfirmationElementFixtures.cs b/src/Slack.Webhooks.Tests/ConfirmationElementFixtures.cs index 77278f6..57ecf38 100644 --- a/src/Slack.Webhooks.Tests/ConfirmationElementFixtures.cs +++ b/src/Slack.Webhooks.Tests/ConfirmationElementFixtures.cs @@ -1,5 +1,7 @@ using FluentAssertions; +using Slack.Webhooks.Classes; using Slack.Webhooks.Elements; +using Slack.Webhooks.Helpers; using Xunit; namespace Slack.Webhooks.Tests @@ -10,10 +12,10 @@ public class ConfirmationElementFixtures public void ShouldSerializeTitle() { // arrange - var confirm = new Confirmation { Title = new TextObject { Text = "Title Test"} }; + var confirm = new Confirmation { Title = new TextObject { Text = "Title Test" } }; // act - var payload = SlackClient.SerializeObject(confirm); + var payload = SerializationHelper.Serialize(confirm); // assert payload.Should().Contain("\"title\":{"); @@ -24,10 +26,10 @@ public void ShouldSerializeTitle() public void ShouldSerializeText() { // arrange - var confirm = new Confirmation { Text = new TextObject { Text = "Title Test"} }; + var confirm = new Confirmation { Text = new TextObject { Text = "Title Test" } }; // act - var payload = SlackClient.SerializeObject(confirm); + var payload = SerializationHelper.Serialize(confirm); // assert payload.Should().Contain("\"text\":{"); @@ -38,10 +40,10 @@ public void ShouldSerializeText() public void ShouldSerializeConfirm() { // arrange - var confirm = new Confirmation { Confirm = new TextObject { Text = "Title Test"} }; + var confirm = new Confirmation { Confirm = new TextObject { Text = "Title Test" } }; // act - var payload = SlackClient.SerializeObject(confirm); + var payload = SerializationHelper.Serialize(confirm); // assert payload.Should().Contain("\"confirm\":{"); @@ -52,10 +54,10 @@ public void ShouldSerializeConfirm() public void ShouldSerializeDeny() { // arrange - var confirm = new Confirmation { Deny = new TextObject { Text = "Title Test"} }; + var confirm = new Confirmation { Deny = new TextObject { Text = "Title Test" } }; // act - var payload = SlackClient.SerializeObject(confirm); + var payload = SerializationHelper.Serialize(confirm); // assert payload.Should().Contain("\"deny\":{"); diff --git a/src/Slack.Webhooks.Tests/ContextBlockFixtures.cs b/src/Slack.Webhooks.Tests/ContextBlockFixtures.cs index 77bf8fd..1b587c5 100644 --- a/src/Slack.Webhooks.Tests/ContextBlockFixtures.cs +++ b/src/Slack.Webhooks.Tests/ContextBlockFixtures.cs @@ -1,7 +1,9 @@ using System.Collections.Generic; using FluentAssertions; using Slack.Webhooks.Blocks; +using Slack.Webhooks.Classes; using Slack.Webhooks.Elements; +using Slack.Webhooks.Helpers; using Slack.Webhooks.Interfaces; using Xunit; @@ -13,13 +15,13 @@ public class ContextBlockFixtures public void ShouldBeAbleToContainImageElements() { // arrange - var context = new Context + var context = new ContextBlock { - Elements = new List() { new Blocks.Image() } + Elements = new List() { new Blocks.ImageBlock() } }; // act - var payload = SlackClient.SerializeObject(context); + var payload = SerializationHelper.Serialize(context); // assert payload.Should().Contain("\"elements\":["); // bleeugh @@ -29,13 +31,13 @@ public void ShouldBeAbleToContainImageElements() public void ShouldBeAbleToContainTextElements() { // arrange - var context = new Context + var context = new ContextBlock { Elements = new List() { new TextObject() } }; // act - var payload = SlackClient.SerializeObject(context); + var payload = SerializationHelper.Serialize(context); // assert payload.Should().Contain("\"elements\":["); // bleeugh diff --git a/src/Slack.Webhooks.Tests/DatePickerElementFixtures.cs b/src/Slack.Webhooks.Tests/DatePickerElementFixtures.cs index 007950a..603753c 100644 --- a/src/Slack.Webhooks.Tests/DatePickerElementFixtures.cs +++ b/src/Slack.Webhooks.Tests/DatePickerElementFixtures.cs @@ -1,5 +1,7 @@ using FluentAssertions; +using Slack.Webhooks.Classes; using Slack.Webhooks.Elements; +using Slack.Webhooks.Helpers; using Xunit; namespace Slack.Webhooks.Tests @@ -13,7 +15,7 @@ public void ShouldSerializeType() var button = new DatePicker(); // act - var payload = SlackClient.SerializeObject(button); + var payload = SerializationHelper.Serialize(button); // assert payload.Should().Contain("\"type\":\"datepicker\""); @@ -26,7 +28,7 @@ public void ShouldSerializeActionId() var button = new DatePicker { ActionId = "Action123" }; // act - var payload = SlackClient.SerializeObject(button); + var payload = SerializationHelper.Serialize(button); // assert payload.Should().Contain("\"action_id\":\"Action123\""); @@ -39,7 +41,7 @@ public void ShouldSerializeInitialDate() var button = new DatePicker { InitialDate = "2019-11-01" }; // act - var payload = SlackClient.SerializeObject(button); + var payload = SerializationHelper.Serialize(button); // assert payload.Should().Contain("\"initial_date\":\"2019-11-01\""); @@ -53,8 +55,8 @@ public void ShouldSerializePlaceholder() var button = new DatePicker { Placeholder = text }; // act - var textPayload = SlackClient.SerializeObject(text); - var payload = SlackClient.SerializeObject(button); + var textPayload = SerializationHelper.Serialize(text); + var payload = SerializationHelper.Serialize(button); // assert payload.Should().Contain($"\"placeholder\":{textPayload}"); @@ -68,8 +70,8 @@ public void ShouldSerializeConfirm() var button = new DatePicker { Confirm = confirm }; // act - var confirmPayload = SlackClient.SerializeObject(confirm); - var payload = SlackClient.SerializeObject(button); + var confirmPayload = SerializationHelper.Serialize(confirm); + var payload = SerializationHelper.Serialize(button); // assert payload.Should().Contain($"\"confirm\":{confirmPayload}"); diff --git a/src/Slack.Webhooks.Tests/ElementFixtures.cs b/src/Slack.Webhooks.Tests/ElementFixtures.cs index f83c334..96c95f5 100644 --- a/src/Slack.Webhooks.Tests/ElementFixtures.cs +++ b/src/Slack.Webhooks.Tests/ElementFixtures.cs @@ -1,5 +1,7 @@ using System.Collections.Generic; using FluentAssertions; +using Slack.Webhooks.Classes; +using Slack.Webhooks.Helpers; using Xunit; namespace Slack.Webhooks.Tests @@ -11,7 +13,7 @@ public class ElementFixtures public void ShouldHaveBlockTypeAndBlockId(Elements.Element element, string expectedType) { // arrange/act - var payload = SlackClient.SerializeObject(element); + var payload = SerializationHelper.Serialize(element); // assert payload.Should().Contain($"\"type\":\"{expectedType}\""); diff --git a/src/Slack.Webhooks.Tests/EmojiShould.cs b/src/Slack.Webhooks.Tests/EmojiShould.cs index f1627d5..ae4d9d4 100644 --- a/src/Slack.Webhooks.Tests/EmojiShould.cs +++ b/src/Slack.Webhooks.Tests/EmojiShould.cs @@ -1,4 +1,6 @@ using Newtonsoft.Json; +using Slack.Webhooks.Classes; +using Slack.Webhooks.Message; using Xunit; namespace Slack.Webhooks.Tests diff --git a/src/Slack.Webhooks.Tests/FileBlockFixtures.cs b/src/Slack.Webhooks.Tests/FileBlockFixtures.cs index b90d936..19ac6ba 100644 --- a/src/Slack.Webhooks.Tests/FileBlockFixtures.cs +++ b/src/Slack.Webhooks.Tests/FileBlockFixtures.cs @@ -1,5 +1,7 @@ using FluentAssertions; using Slack.Webhooks.Blocks; +using Slack.Webhooks.Classes; +using Slack.Webhooks.Helpers; using Xunit; namespace Slack.Webhooks.Tests @@ -10,10 +12,10 @@ public class FileBlockFixtures public void ShouldHaveExternalId() { // arrange - var file = new File { ExternalId = "AB_1234"}; + var file = new FileBlock { ExternalId = "AB_1234" }; // act - var payload = SlackClient.SerializeObject(file); + var payload = SerializationHelper.Serialize(file); // assert payload.Should().Contain("\"external_id\":\"AB_1234\""); @@ -23,10 +25,10 @@ public void ShouldHaveExternalId() public void ShouldHaveRemoteSourceByDefault() { // arrange - var file = new File(); + var file = new FileBlock(); // act - var payload = SlackClient.SerializeObject(file); + var payload = SerializationHelper.Serialize(file); // assert file.Source.Should().Be("remote"); diff --git a/src/Slack.Webhooks.Tests/ImageBlockFixtures.cs b/src/Slack.Webhooks.Tests/ImageBlockFixtures.cs index f525120..0f743bc 100644 --- a/src/Slack.Webhooks.Tests/ImageBlockFixtures.cs +++ b/src/Slack.Webhooks.Tests/ImageBlockFixtures.cs @@ -1,6 +1,8 @@ using FluentAssertions; using Slack.Webhooks.Blocks; +using Slack.Webhooks.Classes; using Slack.Webhooks.Elements; +using Slack.Webhooks.Helpers; using Xunit; namespace Slack.Webhooks.Tests @@ -11,10 +13,10 @@ public class ImageBlockFixtures public void ShouldContainImageUrl() { // arrange - var image = new Blocks.Image { ImageUrl = "http://someimage" }; + var image = new Blocks.ImageBlock { ImageUrl = "http://someimage" }; // act - var payload = SlackClient.SerializeObject(image); + var payload = SerializationHelper.Serialize(image); // assert payload.Should().Contain("\"image_url\":\"http://someimage\""); @@ -24,10 +26,10 @@ public void ShouldContainImageUrl() public void ShouldContainAltText() { // arrange - var image = new Blocks.Image { AltText = "The Text" }; + var image = new Blocks.ImageBlock { AltText = "The Text" }; // act - var payload = SlackClient.SerializeObject(image); + var payload = SerializationHelper.Serialize(image); // assert payload.Should().Contain("\"alt_text\":\"The Text\""); @@ -37,15 +39,15 @@ public void ShouldContainAltText() public void ShouldContainTitle() { // arrange - var image = new Blocks.Image { Title = new TextObject { Text = "The Title"} }; + var image = new Blocks.ImageBlock { Title = new TextObject { Text = "The Title" } }; // act - var payload = SlackClient.SerializeObject(image); + var payload = SerializationHelper.Serialize(image); // assert payload.Should().Contain("\"text\":\"The Title\""); } - + } } \ No newline at end of file diff --git a/src/Slack.Webhooks.Tests/ImageElementFixtures.cs b/src/Slack.Webhooks.Tests/ImageElementFixtures.cs index abe1dc5..069b664 100644 --- a/src/Slack.Webhooks.Tests/ImageElementFixtures.cs +++ b/src/Slack.Webhooks.Tests/ImageElementFixtures.cs @@ -1,5 +1,7 @@ using FluentAssertions; +using Slack.Webhooks.Classes; using Slack.Webhooks.Elements; +using Slack.Webhooks.Helpers; using Xunit; namespace Slack.Webhooks.Tests @@ -13,7 +15,7 @@ public void ShouldSerializeType() var image = new Image(); // act - var payload = SlackClient.SerializeObject(image); + var payload = SerializationHelper.Serialize(image); // assert payload.Should().Contain("\"type\":\"image\""); @@ -26,7 +28,7 @@ public void ShouldSerializeImageUrl() var image = new Image { ImageUrl = "http://someurl.com" }; // act - var payload = SlackClient.SerializeObject(image); + var payload = SerializationHelper.Serialize(image); // assert payload.Should().Contain("\"image_url\":\"http://someurl.com\""); @@ -39,7 +41,7 @@ public void ShouldSerializeAltText() var image = new Image { AltText = "Alternate Text" }; // act - var payload = SlackClient.SerializeObject(image); + var payload = SerializationHelper.Serialize(image); // assert payload.Should().Contain("\"alt_text\":\"Alternate Text\""); diff --git a/src/Slack.Webhooks.Tests/InputBlockFixtures.cs b/src/Slack.Webhooks.Tests/InputBlockFixtures.cs index 2621489..7186103 100644 --- a/src/Slack.Webhooks.Tests/InputBlockFixtures.cs +++ b/src/Slack.Webhooks.Tests/InputBlockFixtures.cs @@ -1,7 +1,9 @@ using System.Collections.Generic; using FluentAssertions; using Slack.Webhooks.Blocks; +using Slack.Webhooks.Classes; using Slack.Webhooks.Elements; +using Slack.Webhooks.Helpers; using Slack.Webhooks.Interfaces; using Xunit; @@ -13,12 +15,12 @@ public class InputBlockFixtures public void ShouldSerializeLabel() { // arrange - var textObject = new TextObject { Text = "Test label"}; - var input = new Input { Label = textObject }; + var textObject = new TextObject { Text = "Test label" }; + var input = new InputBlock { Label = textObject }; // act - var textPayload = SlackClient.SerializeObject(textObject); - var payload = SlackClient.SerializeObject(input); + var textPayload = SerializationHelper.Serialize(textObject); + var payload = SerializationHelper.Serialize(input); // assert payload.Should().Contain($"\"label\":{textPayload}"); @@ -28,25 +30,25 @@ public void ShouldSerializeLabel() public void ShouldSerializeHint() { // arrange - var textObject = new TextObject { Text = "Test hint"}; - var input = new Input { Hint = textObject }; + var textObject = new TextObject { Text = "Test hint" }; + var input = new InputBlock { Hint = textObject }; // act - var textPayload = SlackClient.SerializeObject(textObject); - var payload = SlackClient.SerializeObject(input); + var textPayload = SerializationHelper.Serialize(textObject); + var payload = SerializationHelper.Serialize(input); // assert payload.Should().Contain($"\"hint\":{textPayload}"); } - + [Fact] public void ShouldSerializeOptional() { // arrange - var input = new Input { Optional = true }; + var input = new InputBlock { Optional = true }; // act - var payload = SlackClient.SerializeObject(input); + var payload = SerializationHelper.Serialize(input); // assert payload.Should().Contain("\"optional\":true"); @@ -57,11 +59,11 @@ public void ShouldSerializeOptional() public void ShouldSerializeInputElementTypes(object element) { // arrange - var input = new Input { Element = (IInputElement)element }; + var input = new InputBlock { Element = (IInputElement)element }; // act - var elementPayload = SlackClient.SerializeObject(element); - var payload = SlackClient.SerializeObject(input); + var elementPayload = SerializationHelper.Serialize(element); + var payload = SerializationHelper.Serialize(input); // arrange payload.Should().Contain($"\"element\":{elementPayload}"); diff --git a/src/Slack.Webhooks.Tests/MultiSelectExternalElementFixtures.cs b/src/Slack.Webhooks.Tests/MultiSelectExternalElementFixtures.cs index 59dc38f..9f03a93 100644 --- a/src/Slack.Webhooks.Tests/MultiSelectExternalElementFixtures.cs +++ b/src/Slack.Webhooks.Tests/MultiSelectExternalElementFixtures.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; using FluentAssertions; +using Slack.Webhooks.Classes; using Slack.Webhooks.Elements; +using Slack.Webhooks.Helpers; using Xunit; namespace Slack.Webhooks.Tests @@ -14,7 +16,7 @@ public void ShouldSerializeMinQueryLength() var select = new MultiSelectExternal { MinQueryLength = 5 }; // act - var payload = SlackClient.SerializeObject(select); + var payload = SerializationHelper.Serialize(select); // assert payload.Should().Contain($"\"min_query_length\":5"); @@ -24,12 +26,12 @@ public void ShouldSerializeMinQueryLength() public void ShouldSerializeInitialOptions() { // arrange - var options = new List