Skip to content

Commit

Permalink
Port to netcore3.1 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbaxon authored May 2, 2020
1 parent b046a75 commit a775568
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 641 deletions.
36 changes: 0 additions & 36 deletions RiffChallengeDraft.Core/Properties/AssemblyInfo.cs

This file was deleted.

66 changes: 7 additions & 59 deletions RiffChallengeDraft.Core/RiffChallengeDraft.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,59 +1,7 @@
<?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>{DF09704F-4B67-4594-B545-053E3024F59B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RiffChallengeDraft.Core</RootNamespace>
<AssemblyName>RiffChallengeDraft.Core</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="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" />
</ItemGroup>
<ItemGroup>
<Compile Include="Entities\Genre.cs" />
<Compile Include="Entities\Contestant.cs" />
<Compile Include="Entities\WeeklyTheme.cs" />
<Compile Include="Helpers\EnumMethods.cs" />
<Compile Include="Helpers\StringExtensions.cs" />
<Compile Include="Helpers\TableParserExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</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>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
</PropertyGroup>

</Project>
212 changes: 0 additions & 212 deletions RiffChallengeDraft.Tests/.gitignore

This file was deleted.

22 changes: 14 additions & 8 deletions RiffChallengeDraft.Tests/DraftFacilitatorTest.cs
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NUnit.Framework;
using RiffChallengeDraft.Cli;

namespace RiffChallengeDraft.Tests
{
[TestClass]
public class DraftFacilitatorTest
{
DraftFacilitator enabler = new DraftFacilitator();

/// <summary>
/// If we can draw 1000 times and the number of successfull theme weeks is less than 30%, then we need to adjust the algorithm
/// </summary>
[TestMethod]
[Test]
public void TestThemeWeekProbability()
{
// Arrage
const int NUM_ITERATIONS = 100000;
int iterations = NUM_ITERATIONS;
int successCount = 0;

// Act
while (iterations > 0)
{
successCount += (enabler.WeeklyTheme.IsThemeWeek) ? 1 : 0;
iterations--;
}
//Assume over 30% success rate when choosing WeeklyTheme
Assert.IsTrue(successCount > 0 && successCount > (NUM_ITERATIONS / 3));
// Assert
// Assume over 30% success rate when choosing WeeklyTheme
Assert.Multiple(() =>
{
Assert.That(successCount, Is.Positive);
Assert.That(successCount, Is.GreaterThan(NUM_ITERATIONS / 3));
});
}

[TestMethod]
[Test]
public void TestConstructor()
{
Assert.IsTrue(enabler.ContestantPool != null);
Assert.That(enabler.ContestantPool, Is.Not.Null);
}
}
}
Loading

0 comments on commit a775568

Please sign in to comment.