Skip to content

Commit 0a05089

Browse files
committed
Update Tests project
1 parent b3a6a39 commit 0a05089

File tree

7 files changed

+102
-61
lines changed

7 files changed

+102
-61
lines changed

.nuget/packages.config

Lines changed: 0 additions & 4 deletions
This file was deleted.

SSLLWrapper.Tests/Class1.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

SSLLWrapper.Tests/InfoTests.cs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
using System.IO;
2+
using System.Net;
3+
using FluentAssertions;
4+
using Microsoft.VisualStudio.TestTools.UnitTesting;
5+
using Moq;
6+
using SSLLWrapper.Interfaces;
7+
using SSLLWrapper.Models;
8+
using SSLLWrapper.Models.Response;
9+
10+
namespace SSLLWrapper.Tests
11+
//namespace given_that_I_make_a_info_request
12+
{
13+
[TestClass]
14+
public class when_the_api_is_online
15+
{
16+
private static Info _infoResponse;
17+
18+
[ClassInitialize]
19+
public static void Setup(TestContext testContext)
20+
{
21+
Stream responseStream = new MemoryStream();
22+
var mockedApiProvider = new Mock<IApiProvider>();
23+
var mockedHttpWebResponse = new Mock<HttpWebResponse>();
24+
var streamWriter = new StreamWriter(responseStream);
25+
26+
streamWriter.Write("{\"engineVersion\":\"1.11.4\",\"criteriaVersion\":\"2009i\",\"clientMaxAssessments\":5,\"notice\":\"Some notice goes here\"}");
27+
28+
mockedHttpWebResponse.Setup(x => x.GetResponseStream()).Returns(responseStream);
29+
mockedApiProvider.Setup(x => x.MakeGetRequest(new RequestModel())).Returns(mockedHttpWebResponse.Object);
30+
31+
var ssllService = new SSLLService("https://api.dev.ssllabs.com/api/fa78d5a4/", mockedApiProvider.Object);
32+
_infoResponse = ssllService.Info();
33+
}
34+
35+
[TestMethod]
36+
public void then_no_errors_should_be_created()
37+
{
38+
_infoResponse.Errors.Count.Should().Be(0);
39+
}
40+
41+
[TestMethod]
42+
public void then_the_api_should_be_marked_as_online()
43+
{
44+
_infoResponse.Online.Should().BeTrue();
45+
}
46+
47+
[TestMethod]
48+
public void then_the_info_response_should_be_populated_with_a_engine_number()
49+
{
50+
_infoResponse.engineVersion.Should().NotBeNullOrEmpty();
51+
}
52+
}
53+
}

SSLLWrapper.Tests/SSLLWrapper.Tests.csproj

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
43
<PropertyGroup>
54
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
65
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{96C1BF31-F13B-449B-96BB-BDC0E21A97D8}</ProjectGuid>
6+
<ProjectGuid>{3F2EFE11-F333-4413-9FB9-61BC7CA2D6E6}</ProjectGuid>
87
<OutputType>Library</OutputType>
98
<AppDesignerFolder>Properties</AppDesignerFolder>
109
<RootNamespace>SSLLWrapper.Tests</RootNamespace>
1110
<AssemblyName>SSLLWrapper.Tests</AssemblyName>
1211
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1312
<FileAlignment>512</FileAlignment>
13+
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
15+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
16+
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
17+
<IsCodedUITest>False</IsCodedUITest>
18+
<TestProjectType>UnitTest</TestProjectType>
1419
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
1520
<RestorePackages>true</RestorePackages>
1621
</PropertyGroup>
@@ -32,49 +37,67 @@
3237
<WarningLevel>4</WarningLevel>
3338
</PropertyGroup>
3439
<ItemGroup>
35-
<Reference Include="FluentAssertions">
40+
<Reference Include="FluentAssertions, Version=3.2.2.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
41+
<SpecificVersion>False</SpecificVersion>
3642
<HintPath>..\packages\FluentAssertions.3.2.2\lib\net45\FluentAssertions.dll</HintPath>
3743
</Reference>
3844
<Reference Include="FluentAssertions.Core">
3945
<HintPath>..\packages\FluentAssertions.3.2.2\lib\net45\FluentAssertions.Core.dll</HintPath>
4046
</Reference>
41-
<Reference Include="FluentTests.Framework">
42-
<HintPath>..\packages\FluentTests.1.1.1\lib\FluentTests.Framework.dll</HintPath>
43-
</Reference>
44-
<Reference Include="FluentTests.NUnit">
45-
<HintPath>..\packages\FluentTests.NUnit.1.1.2\lib\FluentTests.NUnit.dll</HintPath>
46-
</Reference>
4747
<Reference Include="Moq">
4848
<HintPath>..\packages\Moq.4.2.1409.1722\lib\net40\Moq.dll</HintPath>
4949
</Reference>
50-
<Reference Include="nunit.framework">
51-
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
52-
</Reference>
53-
<Reference Include="NUnit.Should">
54-
<HintPath>..\packages\NUnit.Should.1.0.2.0\lib\NET30\NUnit.Should.dll</HintPath>
50+
<Reference Include="MSTest.Fluent">
51+
<HintPath>..\packages\MSTest.Fluent.1.1.0\lib\net45\MSTest.Fluent.dll</HintPath>
5552
</Reference>
5653
<Reference Include="System" />
57-
<Reference Include="System.Core" />
58-
<Reference Include="System.Xml.Linq" />
59-
<Reference Include="System.Data.DataSetExtensions" />
60-
<Reference Include="Microsoft.CSharp" />
61-
<Reference Include="System.Data" />
6254
<Reference Include="System.Xml" />
55+
<Reference Include="System.Xml.Linq" />
6356
</ItemGroup>
57+
<Choose>
58+
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
59+
<ItemGroup>
60+
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
61+
</ItemGroup>
62+
</When>
63+
<Otherwise>
64+
<ItemGroup>
65+
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
66+
</ItemGroup>
67+
</Otherwise>
68+
</Choose>
6469
<ItemGroup>
65-
<Compile Include="Class1.cs" />
70+
<Compile Include="InfoTests.cs" />
6671
<Compile Include="Properties\AssemblyInfo.cs" />
6772
</ItemGroup>
68-
<ItemGroup>
69-
<None Include="app.config" />
70-
<None Include="packages.config" />
71-
</ItemGroup>
7273
<ItemGroup>
7374
<ProjectReference Include="..\SSLLWrapper\SSLLWrapper.csproj">
74-
<Project>{9D2FF62D-01C0-41B0-A3BE-32005365290C}</Project>
75+
<Project>{9d2ff62d-01c0-41b0-a3be-32005365290c}</Project>
7576
<Name>SSLLWrapper</Name>
7677
</ProjectReference>
7778
</ItemGroup>
79+
<ItemGroup>
80+
<None Include="packages.config" />
81+
</ItemGroup>
82+
<Choose>
83+
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
84+
<ItemGroup>
85+
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
86+
<Private>False</Private>
87+
</Reference>
88+
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
89+
<Private>False</Private>
90+
</Reference>
91+
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
92+
<Private>False</Private>
93+
</Reference>
94+
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
95+
<Private>False</Private>
96+
</Reference>
97+
</ItemGroup>
98+
</When>
99+
</Choose>
100+
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
78101
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
79102
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
80103
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

SSLLWrapper.Tests/app.config

Lines changed: 0 additions & 15 deletions
This file was deleted.

SSLLWrapper.Tests/packages.config

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="FluentAssertions" version="3.2.2" targetFramework="net45" />
4-
<package id="FluentTests" version="1.1.1" targetFramework="net45" />
5-
<package id="FluentTests.NUnit" version="1.1.2" targetFramework="net45" />
64
<package id="Moq" version="4.2.1409.1722" targetFramework="net45" />
7-
<package id="NUnit" version="2.6.4" targetFramework="net45" />
8-
<package id="NUnit.Should" version="1.0.2.0" targetFramework="net45" />
5+
<package id="MSTest.Fluent" version="1.1.0" targetFramework="net45" />
96
</packages>

SSLLWrapper.sln

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{06122B
99
ProjectSection(SolutionItems) = preProject
1010
.nuget\NuGet.Config = .nuget\NuGet.Config
1111
.nuget\NuGet.exe = .nuget\NuGet.exe
12-
.nuget\NuGet.targets = .nuget\NuGet.targets
1312
EndProjectSection
1413
EndProject
1514
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SSLLWrapper.Tests", "SSLLWrapper.Tests\SSLLWrapper.Tests.csproj", "{3F2EFE11-F333-4413-9FB9-61BC7CA2D6E6}"

0 commit comments

Comments
 (0)