Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Unit Tests #8

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,5 @@ FakesAssemblies/
*.opt

# Build Related
tools/
tools/
BuildArtifacts/
91 changes: 91 additions & 0 deletions Source/Cake.Gitter.Tests/Cake.Gitter.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{044756A7-EEA4-4DBB-9489-95781BB1BC7B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Cake.Gitter.Tests</RootNamespace>
<AssemblyName>Cake.Gitter.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Cake.Core, Version=0.8.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Cake.Core.0.8.0\lib\net45\Cake.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Cake.Testing, Version=0.8.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Cake.Testing.0.8.0\lib\net45\Cake.Testing.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NSubstitute, Version=1.9.2.0, Culture=neutral, PublicKeyToken=92dd2e9066daa5ca, processorArchitecture=MSIL">
<HintPath>..\packages\NSubstitute.1.9.2.0\lib\net45\NSubstitute.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.assert">
<HintPath>..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.core">
<HintPath>..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.execution.desktop">
<HintPath>..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Cake.Gitter\Cake.Gitter.csproj">
<Project>{0bb62fd9-8844-4bca-bcae-9c01418a2c14}</Project>
<Name>Cake.Gitter</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
35 changes: 35 additions & 0 deletions Source/Cake.Gitter.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Reflection;
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("Cake.Gitter.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Cake.Gitter.Tests")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[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("044756a7-eea4-4dbb-9489-95781bb1bc7b")]

// 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")]
11 changes: 11 additions & 0 deletions Source/Cake.Gitter.Tests/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
12 changes: 12 additions & 0 deletions Source/Cake.Gitter.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cake.Core" version="0.8.0" targetFramework="net452" />
<package id="Cake.Testing" version="0.8.0" targetFramework="net452" />
<package id="NSubstitute" version="1.9.2.0" targetFramework="net452" />
<package id="xunit" version="2.1.0" targetFramework="net452" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net452" />
<package id="xunit.assert" version="2.1.0" targetFramework="net452" />
<package id="xunit.core" version="2.1.0" targetFramework="net452" />
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net452" />
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net452" />
</packages>
8 changes: 7 additions & 1 deletion Source/Cake.Gitter.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.Gitter", "Cake.Gitter\Cake.Gitter.csproj", "{0BB62FD9-8844-4BCA-BCAE-9C01418A2C14}"
EndProject
Expand All @@ -22,6 +22,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{09555D29
..\Tools\packages.config = ..\Tools\packages.config
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.Gitter.Tests", "Cake.Gitter.Tests\Cake.Gitter.Tests.csproj", "{044756A7-EEA4-4DBB-9489-95781BB1BC7B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -32,6 +34,10 @@ Global
{0BB62FD9-8844-4BCA-BCAE-9C01418A2C14}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0BB62FD9-8844-4BCA-BCAE-9C01418A2C14}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0BB62FD9-8844-4BCA-BCAE-9C01418A2C14}.Release|Any CPU.Build.0 = Release|Any CPU
{044756A7-EEA4-4DBB-9489-95781BB1BC7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{044756A7-EEA4-4DBB-9489-95781BB1BC7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{044756A7-EEA4-4DBB-9489-95781BB1BC7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{044756A7-EEA4-4DBB-9489-95781BB1BC7B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
42 changes: 18 additions & 24 deletions Source/Cake.Gitter/Cake.Gitter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,48 +42,41 @@
<DocumentationFile>bin\Release\Cake.Gitter.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Cake.Common, Version=0.5.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Cake.Common.0.5.5\lib\net45\Cake.Common.dll</HintPath>
<Reference Include="Cake.Common, Version=0.8.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Cake.Common.0.8.0\lib\net45\Cake.Common.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Cake.Core, Version=0.5.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Cake.Core.0.5.5\lib\net45\Cake.Core.dll</HintPath>
<Reference Include="Cake.Core, Version=0.8.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Cake.Core.0.8.0\lib\net45\Cake.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="GitterSharp.Configuration, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\gitter-api-pcl.0.4.5\lib\net45\GitterSharp.Configuration.dll</HintPath>
<HintPath>..\packages\gitter-api-pcl.0.5.4\lib\net45\GitterSharp.Configuration.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="GitterSharp.Helpers, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\gitter-api-pcl.0.4.5\lib\net45\GitterSharp.Helpers.dll</HintPath>
<HintPath>..\packages\gitter-api-pcl.0.5.4\lib\net45\GitterSharp.Helpers.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="GitterSharp.Model, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\gitter-api-pcl.0.4.5\lib\net45\GitterSharp.Model.dll</HintPath>
<HintPath>..\packages\gitter-api-pcl.0.5.4\lib\net45\GitterSharp.Model.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="GitterSharp.NetFramework, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\gitter-api-pcl.0.4.5\lib\net45\GitterSharp.NetFramework.dll</HintPath>
<HintPath>..\packages\gitter-api-pcl.0.5.4\lib\net45\GitterSharp.NetFramework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="GitterSharp.Services, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\gitter-api-pcl.0.4.5\lib\net45\GitterSharp.Services.dll</HintPath>
<HintPath>..\packages\gitter-api-pcl.0.5.4\lib\net45\GitterSharp.Services.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http">
<HintPath>..\packages\System.Net.Http.2.0.20126.16343\lib\net40\System.Net.Http.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.WebRequest">
<HintPath>..\packages\System.Net.Http.2.0.20126.16343\lib\net40\System.Net.Http.WebRequest.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Reactive.Core, Version=2.2.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Rx-Core.2.2.5\lib\net45\System.Reactive.Core.dll</HintPath>
<Private>True</Private>
Expand Down Expand Up @@ -142,19 +135,20 @@
</Content>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0-beta013\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0-beta013\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.1.29.3\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.1.29.3\build\dotnet\Fody.targets')" />
<Import Project="..\packages\Fody.1.29.4\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.1.29.4\build\dotnet\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.1.29.3\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.3\build\dotnet\Fody.targets'))" />
<Error Condition="!Exists('..\packages\Fody.1.29.4\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.4\build\dotnet\Fody.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
6 changes: 3 additions & 3 deletions Source/Cake.Gitter/Chat/GitterChatMessageResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public GitterChatMessageResult(bool ok, string timeStamp, string error)
}

/// <summary>
/// Indicating success or failure, <see cref="Error"/> for info on failure
/// Gets a value indicating whether success or failure, <see cref="Error"/> for info on failure
/// </summary>
public bool Ok
{
Expand All @@ -38,7 +38,7 @@ public bool Ok
}

/// <summary>
/// Timestamp of the message
/// Gets the Timestamp of the message
/// </summary>
public string TimeStamp
{
Expand All @@ -49,7 +49,7 @@ public string TimeStamp
}

/// <summary>
/// Error message on failure
/// Gets the Error message on failure
/// </summary>
public string Error
{
Expand Down
10 changes: 5 additions & 5 deletions Source/Cake.Gitter/Chat/GitterChatMessageSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@ namespace Cake.Gitter.Chat
public sealed class GitterChatMessageSettings
{
/// <summary>
/// Gitter token used for authentication.
/// Gets or sets Gitter token used for authentication.
/// </summary>
public string Token { get; set; }

/// <summary>
/// Gitter Room Id.
/// Gets or sets Gitter Room Id.
/// </summary>
public string RoomId { get; set; }

/// <summary>
/// This can be used instead of token (https://developer.gitter.im/docs/rest-api)
/// Gets or sets the Incoming Web Hook Url which can be used instead of token (https://developer.gitter.im/docs/rest-api)
/// </summary>
public string IncomingWebHookUrl { get; set; }

/// <summary>
/// Gitter Message Level
/// Gets or sets Gitter Message Level
/// </summary>
/// <remarks>Default is Info</remarks>
public GitterMessageLevel MessageLevel { get; set; }

/// <summary>
/// Optional flag for if should throw exception on failure
/// Gets or sets an optional flag for if should throw exception on failure
/// </summary>
public bool? ThrowOnFail { get; set; }
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Cake.Gitter/GitterProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public GitterProvider(ICakeContext context)
}

/// <summary>
/// The Gitter Chat functionality.
/// Gets the Gitter Chat Provider.
/// </summary>
public GitterChatProvider Chat
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Cake.Gitter/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
14 changes: 7 additions & 7 deletions Source/Cake.Gitter/packages.config
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Cake.Common" version="0.5.5" targetFramework="net452" />
<package id="Cake.Core" version="0.5.5" targetFramework="net452" />
<package id="Cake.Common" version="0.8.0" targetFramework="net452" />
<package id="Cake.Core" version="0.8.0" targetFramework="net452" />
<package id="Costura.Fody" version="1.3.5.0" targetFramework="net452" developmentDependency="true" />
<package id="Fody" version="1.29.3" targetFramework="net452" developmentDependency="true" />
<package id="gitter-api-pcl" version="0.4.5" targetFramework="net452" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net452" />
<package id="Fody" version="1.29.4" targetFramework="net452" developmentDependency="true" />
<package id="gitter-api-pcl" version="0.5.4" targetFramework="net452" />
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net452" />
<package id="Rx-Core" version="2.2.5" targetFramework="net452" />
<package id="Rx-Interfaces" version="2.2.5" targetFramework="net452" />
<package id="Rx-Linq" version="2.2.5" targetFramework="net452" />
<package id="Rx-Main" version="2.2.5" targetFramework="net452" />
<package id="Rx-PlatformServices" version="2.2.5" targetFramework="net452" />
<package id="StyleCop.Analyzers" version="1.0.0-beta013" targetFramework="net452" developmentDependency="true" />
<package id="System.Net.Http" version="2.0.20126.16343" targetFramework="net452" />
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="net452" developmentDependency="true" />
<package id="System.Net.Http" version="4.0.0" targetFramework="net452" />
</packages>
2 changes: 1 addition & 1 deletion Source/SolutionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
[assembly: AssemblyVersion("0.2.0")]
[assembly: AssemblyFileVersion("0.2.0")]
[assembly: AssemblyInformationalVersion("0.2.0")]
[assembly: AssemblyCopyright("Copyright © gep13 2015 - Present")]
[assembly: AssemblyCopyright("Copyright © gep13 2016 - Present")]
[assembly: CLSCompliant(true)]

Loading