Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Commit

Permalink
Merge pull request #6 from technology-toolbox/revert-5-users/jjameson…
Browse files Browse the repository at this point in the history
…/dev

Revert "Convert tests from MbUnit to MSTest"
  • Loading branch information
jeremy-jameson committed Nov 21, 2019
2 parents d477df5 + a90cf0c commit f905d9e
Show file tree
Hide file tree
Showing 198 changed files with 2,365 additions and 2,313 deletions.
5 changes: 4 additions & 1 deletion src/Subtext.Framework/SubText.Framework.csproj
Expand Up @@ -145,9 +145,11 @@
<HintPath>..\Dependencies\blowery.Web.HttpCompress.dll</HintPath>
</Reference>
<Reference Include="CookComputing.XmlRpcV2, Version=2.5.0.0, Culture=neutral, PublicKeyToken=a7d6e17aa302004d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\log4net.1.2.11\lib\net40-full\log4net.dll</HintPath>
</Reference>
<Reference Include="Lucene.Net, Version=2.9.2.2, Culture=neutral, processorArchitecture=MSIL">
Expand All @@ -162,6 +164,7 @@
<Private>True</Private>
</Reference>
<Reference Include="Ninject, Version=2.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Ninject.2.2.1.4\lib\net40-Full\Ninject.dll</HintPath>
</Reference>
<Reference Include="NuGet.Core, Version=1.3.20419.9005, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down
6 changes: 3 additions & 3 deletions src/Subtext.Framework/packages.config
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="blogml" version="2.2.0" />
<package id="log4net" version="1.2.11" targetFramework="net40" />
<package id="log4net" version="1.2.11" />
<package id="Lucene" version="2.9.2.2" />
<package id="Microsoft.AspNet.Mvc" version="3.0.20105.1" targetFramework="net40" />
<package id="Microsoft.AspNet.Razor" version="1.0.20105.408" targetFramework="net40" />
<package id="Microsoft.AspNet.WebPages" version="1.0.20105.408" targetFramework="net40" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
<package id="Ninject" version="2.2.1.4" targetFramework="net40" />
<package id="Ninject" version="2.2.1.4" />
<package id="NuGet.Core" version="1.3.20419.9005" />
<package id="xmlrpcnet" version="2.5.0" targetFramework="net40" />
<package id="xmlrpcnet" version="2.5.0" />
</packages>
Expand Up @@ -136,13 +136,14 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="CookComputing.XmlRpcV2, Version=2.5.0.0, Culture=neutral, PublicKeyToken=a7d6e17aa302004d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
</Reference>
<Reference Include="FredCK.FCKeditorV2">
<Name>FredCK.FCKeditorV2</Name>
<HintPath>..\Dependencies\FredCK.FCKeditorV2.dll</HintPath>
</Reference>
<Reference Include="Ninject, Version=2.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<Reference Include="Ninject">
<HintPath>..\packages\Ninject.2.2.1.4\lib\net40-Full\Ninject.dll</HintPath>
</Reference>
<Reference Include="System">
Expand Down
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Ninject" version="2.2.1.4" targetFramework="net40" />
<package id="xmlrpcnet" version="2.5.0" targetFramework="net40" />
<package id="xmlrpcnet" version="2.5.0" />
<package id="Ninject" version="2.2.1.4" />
</packages>
13 changes: 5 additions & 8 deletions src/Subtext.Web/SubText.Web.csproj
Expand Up @@ -38,12 +38,6 @@
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<MvcProjectUpgradeChecked>true</MvcProjectUpgradeChecked>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -85,6 +79,7 @@
<HintPath>..\packages\blogml.2.2.0\lib\BlogML.dll</HintPath>
</Reference>
<Reference Include="CookComputing.XmlRpcV2, Version=2.5.0.0, Culture=neutral, PublicKeyToken=a7d6e17aa302004d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
</Reference>
<Reference Include="DotNetOpenAuth, Version=3.4.7.11121, Culture=neutral, PublicKeyToken=2780ccd10d57b246, processorArchitecture=MSIL">
Expand All @@ -111,7 +106,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\jayrock-json.0.9.12915\lib\net4\Jayrock.Json.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\log4net.1.2.11\lib\net40-full\log4net.dll</HintPath>
</Reference>
<Reference Include="Lucene.Net, Version=2.9.2.2, Culture=neutral, processorArchitecture=MSIL">
Expand All @@ -126,6 +122,7 @@
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="Ninject, Version=2.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Ninject.2.2.1.4\lib\net40-Full\Ninject.dll</HintPath>
</Reference>
<Reference Include="Ninject.Web.Mvc">
Expand Down Expand Up @@ -2599,7 +2596,7 @@
-->
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349C5851-65DF-11DA-9384-00065B846F21}">
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>False</AutoAssignPort>
Expand Down
6 changes: 3 additions & 3 deletions src/Subtext.Web/packages.config
Expand Up @@ -6,15 +6,15 @@
<package id="HttpModuleMagic" version="0.1" />
<package id="jayrock" version="0.9.12915" />
<package id="jayrock-json" version="0.9.12915" />
<package id="log4net" version="1.2.11" targetFramework="net40" />
<package id="log4net" version="1.2.11" />
<package id="Lucene" version="2.9.2.2" />
<package id="Microsoft.AspNet.Mvc" version="3.0.20105.1" targetFramework="net40" />
<package id="Microsoft.AspNet.Razor" version="1.0.20105.408" targetFramework="net40" />
<package id="Microsoft.AspNet.WebPages" version="1.0.20105.408" targetFramework="net40" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" />
<package id="Ninject" version="2.2.1.4" targetFramework="net40" />
<package id="Ninject" version="2.2.1.4" />
<package id="Ninject.MVC3" version="2.2.2.0" />
<package id="NuGet.Core" version="1.3.20419.9005" />
<package id="WebActivator" version="1.5" />
<package id="xmlrpcnet" version="2.5.0" targetFramework="net40" />
<package id="xmlrpcnet" version="2.5.0" />
</packages>
34 changes: 17 additions & 17 deletions src/UnitTests.Subtext/Akismet/AkismetApiTests.cs
Expand Up @@ -3,37 +3,37 @@
using System.Globalization;
using System.Net;
using System.Web;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MbUnit.Framework;
using Moq;
using Subtext.Akismet;

namespace UnitTests.Subtext.Akismet
{
[TestClass]
[TestFixture]
public class AkismetApiTests
{
[TestMethod]
[Test]
public void Ctor_WithNullApiKey_ThrowsArgumentNullException()
{
// act, assert
UnitTestHelper.AssertThrowsArgumentNullException(() => new AkismetClient(null, new Uri("http://example.com/"), new HttpClient()));
}

[TestMethod]
[Test]
public void Ctor_WithNullBlogUrl_ThrowsArgumentNullException()
{
// act, assert
UnitTestHelper.AssertThrowsArgumentNullException(() => new AkismetClient("api-key", null, new HttpClient()));
}

[TestMethod]
[Test]
public void Ctor_WithNullHttpClient_ThrowsArgumentNullException()
{
// act, assert
UnitTestHelper.AssertThrowsArgumentNullException(() => new AkismetClient("api-key", new Uri("http://example.com/"), null));
}

[TestMethod]
[Test]
public void CheckCommentForSpam_WithNullComment_ThrowsArgumentNullException()
{
// arrange
Expand All @@ -43,7 +43,7 @@ public void CheckCommentForSpam_WithNullComment_ThrowsArgumentNullException()
UnitTestHelper.AssertThrowsArgumentNullException(() => client.CheckCommentForSpam(null));
}

[TestMethod]
[Test]
public void CanSetAndGetCommentProperties()
{
var comment = new Comment(IPAddress.Loopback, "Test");
Expand All @@ -56,7 +56,7 @@ public void CanSetAndGetCommentProperties()
Assert.AreEqual(1, comment.ServerEnvironmentVariables.Count);
}

[TestMethod]
[Test]
public void ConstructorSetsApiKeyAndUrl()
{
var client = new AkismetClient("fake-key", new Uri("http://haacked.com/"), new HttpClient());
Expand All @@ -65,7 +65,7 @@ public void ConstructorSetsApiKeyAndUrl()
UnitTestHelper.AssertSimpleProperties(client, "ApiKey");
}

[TestMethod]
[Test]
public void CanVerifyApiKey()
{
//arrange
Expand All @@ -84,7 +84,7 @@ public void CanVerifyApiKey()
Assert.IsTrue(isVerified, "If the request returns 'valid' we should return true.");
}

[TestMethod]
[Test]
public void CanVerifyApiKeyIsWrong()
{
//act
Expand All @@ -103,7 +103,7 @@ public void CanVerifyApiKeyIsWrong()
Assert.IsFalse(isVerified, "If the request returns 'invalid' then we should return false!");
}

[TestMethod]
[Test]
public void CanCheckCommentForSpam()
{
string userAgent = GetExpectedUserAgent();
Expand Down Expand Up @@ -142,7 +142,7 @@ public void CanCheckCommentForSpam()
"If the request returns 'false' then we should return false!");
}

[TestMethod]
[Test]
public void CanCheckCommentForSpamWithoutOptionalParams()
{
string userAgent = GetExpectedUserAgent();
Expand Down Expand Up @@ -176,7 +176,7 @@ public void CanCheckCommentForSpamWithoutOptionalParams()
"If the request returns 'false' then we should return false!");
}

[TestMethod]
[Test]
public void CanCheckCommentWithArbitraryServerParams()
{
string userAgent = GetExpectedUserAgent();
Expand Down Expand Up @@ -218,9 +218,9 @@ public void CanCheckCommentWithArbitraryServerParams()
"If the request returns 'false' then we should return false!");
}

[DataTestMethod]
[DataRow("submit-ham", true)]
[DataRow("submit-spam", false)]
[RowTest]
[Row("submit-ham", true)]
[Row("submit-spam", false)]
public void SubmitHamTest(string urlEnding, bool isHam)
{
string userAgent = GetExpectedUserAgent();
Expand Down Expand Up @@ -264,7 +264,7 @@ public void SubmitHamTest(string urlEnding, bool isHam)
/// The comment check call returns "invalid" if the api key is not valid
/// on the URL. The apikey must be the first part of the url.
/// </summary>
[TestMethod]
[Test]
public void ThrowsInvalidResponseWhenApiKeyInvalid()
{
// arrange
Expand Down
10 changes: 5 additions & 5 deletions src/UnitTests.Subtext/Akismet/AkismetSpamServiceTests.cs
@@ -1,5 +1,5 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MbUnit.Framework;
using Moq;
using Subtext.Akismet;
using Subtext.Extensibility;
Expand All @@ -10,10 +10,10 @@

namespace UnitTests.Subtext.Akismet
{
[TestClass]
[TestFixture]
public class AkismetSpamServiceTests
{
[TestMethod]
[Test]
public void Service_WithUrlHelper_UsesItForFeedbackUrl()
{
//arrange
Expand All @@ -36,7 +36,7 @@ public void Service_WithUrlHelper_UsesItForFeedbackUrl()
Assert.AreEqual("http://localhost/feedback-item", submittedSpam.Permalink.ToString());
}

[TestMethod]
[Test]
public void ConvertToAkismetItem_WithContactPageFeedback_DoesNotSetPermalink()
{
// arrange
Expand All @@ -53,7 +53,7 @@ public void ConvertToAkismetItem_WithContactPageFeedback_DoesNotSetPermalink()
Assert.IsNull(comment.Permalink);
}

[TestMethod]
[Test]
public void ConvertToAkismetItem_WithFeedback_SetsProperties()
{
// arrange
Expand Down
3 changes: 0 additions & 3 deletions src/UnitTests.Subtext/App.config
Expand Up @@ -209,9 +209,6 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
Expand Down
15 changes: 8 additions & 7 deletions src/UnitTests.Subtext/AssemblySetUpAndCleanUp.cs
@@ -1,19 +1,20 @@
using System;
using System.Configuration;
using System.Data.SqlClient;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MbUnit.Framework;
using Subtext.Framework.Configuration;
using Subtext.Framework.Infrastructure.Installation;
using UnitTests.Subtext;

[assembly: AssemblyCleanup(typeof(AssemblySetUpAndCleanUp))]

namespace UnitTests.Subtext
{
[TestClass]
public static class AssemblySetUpAndCleanUp
{
[AssemblyInitialize]
[SetUp]
[CoverageExclude]
public static void AssemblyInitialize(TestContext context)
public static void SetUp()
{
Console.WriteLine("Assembly Setup beginning...");
if (ConfigurationManager.AppSettings["connectionStringName"] == "subtextExpress")
Expand Down Expand Up @@ -43,9 +44,9 @@ public static void AssemblyInitialize(TestContext context)
}
}

[AssemblyCleanup]
[TearDown]
[CoverageExclude]
public static void AssemblyCleanup()
public static void TearDown()
{
try
{
Expand All @@ -69,4 +70,4 @@ public static void AssemblyCleanup()
}
}
}
}
}
@@ -1,15 +1,15 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MbUnit.Framework;
using Moq;
using Subtext.Framework;
using Subtext.Providers.BlogEntryEditor.FCKeditor;

namespace UnitTests.Subtext.BlogEntryProvider
{
[TestClass]
[TestFixture]
public class FileBrowserConnectorTests
{
[TestMethod]
[Test]
public void FileBrowserConnector_WithNonAdmin_SetsUnauthorizedStatusCode()
{
// arrange
Expand All @@ -29,7 +29,7 @@ public void FileBrowserConnector_WithNonAdmin_SetsUnauthorizedStatusCode()
subtextContext.VerifySet(c => c.HttpContext.Response.StatusCode, 401);
}

[TestMethod]
[Test]
public void FileBrowserConnector_WithAdmin_DoesNotSetUnauthorizedStatusCode()
{
// arrange
Expand Down

0 comments on commit f905d9e

Please sign in to comment.