Skip to content

Commit

Permalink
Merge branch 'nunit'
Browse files Browse the repository at this point in the history
Conflicts:
	.travis.yml
  • Loading branch information
cheesemacfly committed Dec 14, 2014
2 parents 3719139 + 124b68c commit 3685982
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 58 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
language: csharp
solution: MTAServiceStatus/MTAServiceStatus.csproj
install:
- sudo apt-get install mono-devel mono-gmcs nunit-console
script:
- xbuild /p:Configuration=Release MTAServiceStatus.sln
- nunit-console Tests/bin/Release/Tests.dll
10 changes: 5 additions & 5 deletions MTAServiceStatus.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MTAServiceStatus", "MTAServiceStatus\MTAServiceStatus.csproj", "{8CF4C896-D955-4D6E-A796-BCE9E54BE849}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{BC235DB0-6FB8-4141-A999-88FECBCEF42A}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{698E932F-9B11-4DD1-A9CA-85A9E63204FF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -17,10 +17,10 @@ Global
{8CF4C896-D955-4D6E-A796-BCE9E54BE849}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8CF4C896-D955-4D6E-A796-BCE9E54BE849}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8CF4C896-D955-4D6E-A796-BCE9E54BE849}.Release|Any CPU.Build.0 = Release|Any CPU
{BC235DB0-6FB8-4141-A999-88FECBCEF42A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BC235DB0-6FB8-4141-A999-88FECBCEF42A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BC235DB0-6FB8-4141-A999-88FECBCEF42A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BC235DB0-6FB8-4141-A999-88FECBCEF42A}.Release|Any CPU.Build.0 = Release|Any CPU
{698E932F-9B11-4DD1-A9CA-85A9E63204FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{698E932F-9B11-4DD1-A9CA-85A9E63204FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{698E932F-9B11-4DD1-A9CA-85A9E63204FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{698E932F-9B11-4DD1-A9CA-85A9E63204FF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
34 changes: 21 additions & 13 deletions Tests/MTARepositoryTests.cs
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MTAServiceStatus.Repositories;
using MTAServiceStatus.Repositories;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tests
{
[TestClass]
[TestFixture]
public class MTARepositoryTests
{
[TestMethod]
public async Task GetSubwayStatusAsyncTests()
[Test]
public void GetSubwayStatusAsyncTests()
{
var repo = new MTARepository();
var result = await repo.GetStatusAsync();

Assert.IsNotNull(result);
Assert.DoesNotThrow(async () =>
{
var result = await repo.GetStatusAsync();
Assert.AreNotEqual<int>(0, result.BT.Count);
Assert.IsNotNull(result);
Assert.AreNotEqual<int>(0, result.bus.Count);
Assert.IsNotEmpty(result.BT);
Assert.AreNotEqual<int>(0, result.LIRR.Count);
Assert.IsNotEmpty(result.bus);
Assert.AreNotEqual<int>(0, result.MetroNorth.Count);
Assert.IsNotEmpty(result.LIRR);
Assert.AreNotEqual<int>(0, result.subway.Count);
Assert.IsNotEmpty(result.MetroNorth);
Assert.AreEqual<int>(0, result.responsecode);
Assert.IsNotEmpty(result.subway);
Assert.AreEqual(0, result.responsecode);
});
}
}
}
2 changes: 1 addition & 1 deletion Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0db61ba1-0d15-4688-adb3-464247cb7a15")]
[assembly: Guid("bbb5688f-e334-4fb3-b83b-ec47b78af0e9")]

// Version information for an assembly consists of the following four values:
//
Expand Down
55 changes: 17 additions & 38 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.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>{BC235DB0-6FB8-4141-A999-88FECBCEF42A}</ProjectGuid>
<ProjectGuid>{698E932F-9B11-4DD1-A9CA-85A9E63204FF}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Tests</RootNamespace>
<AssemblyName>Tests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -35,49 +30,33 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
</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.Xml" />
</ItemGroup>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="MTARepositoryTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MTAServiceStatus\MTAServiceStatus.csproj">
<Project>{8cf4c896-d955-4d6e-a796-bce9e54be849}</Project>
<Name>MTAServiceStatus</Name>
</ProjectReference>
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</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.
Expand Down
4 changes: 4 additions & 0 deletions Tests/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.3" targetFramework="net45" />
</packages>

0 comments on commit 3685982

Please sign in to comment.