diff --git a/RiffChallengeDraft.Core/Properties/AssemblyInfo.cs b/RiffChallengeDraft.Core/Properties/AssemblyInfo.cs deleted file mode 100644 index be0aec1..0000000 --- a/RiffChallengeDraft.Core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -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("RiffChallengeDraft.Core")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("RiffChallengeDraft.Core")] -[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("df09704f-4b67-4594-b545-053e3024f59b")] - -// 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")] diff --git a/RiffChallengeDraft.Core/RiffChallengeDraft.Core.csproj b/RiffChallengeDraft.Core/RiffChallengeDraft.Core.csproj index 4dfd5a5..e183d57 100644 --- a/RiffChallengeDraft.Core/RiffChallengeDraft.Core.csproj +++ b/RiffChallengeDraft.Core/RiffChallengeDraft.Core.csproj @@ -1,59 +1,7 @@ - - - - - Debug - AnyCPU - {DF09704F-4B67-4594-B545-053E3024F59B} - Library - Properties - RiffChallengeDraft.Core - RiffChallengeDraft.Core - v4.5.2 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + netstandard2.1 + + + diff --git a/RiffChallengeDraft.Tests/.gitignore b/RiffChallengeDraft.Tests/.gitignore deleted file mode 100644 index b06e864..0000000 --- a/RiffChallengeDraft.Tests/.gitignore +++ /dev/null @@ -1,212 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -[Bb]in/ -[Oo]bj/ - -# Visual Studio 2015 cache/options directory -.vs/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -## TODO: Comment the next line if you want to checkin your -## web deploy settings but do note that will include unencrypted -## passwords -#*.pubxml - -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config - -# Windows Azure Build Output -csx/ -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# LightSwitch generated files -GeneratedArtifacts/ -_Pvt_Extensions/ -ModelManifest.xml diff --git a/RiffChallengeDraft.Tests/DraftFacilitatorTest.cs b/RiffChallengeDraft.Tests/DraftFacilitatorTest.cs index 1bc5883..fe13a28 100644 --- a/RiffChallengeDraft.Tests/DraftFacilitatorTest.cs +++ b/RiffChallengeDraft.Tests/DraftFacilitatorTest.cs @@ -1,10 +1,8 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; +using NUnit.Framework; using RiffChallengeDraft.Cli; namespace RiffChallengeDraft.Tests { - [TestClass] public class DraftFacilitatorTest { DraftFacilitator enabler = new DraftFacilitator(); @@ -12,25 +10,33 @@ public class DraftFacilitatorTest /// /// If we can draw 1000 times and the number of successfull theme weeks is less than 30%, then we need to adjust the algorithm /// - [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); } } } diff --git a/RiffChallengeDraft.Tests/Properties/AssemblyInfo.cs b/RiffChallengeDraft.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 773cb74..0000000 --- a/RiffChallengeDraft.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -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("riff-challenge-draft.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("riff-challenge-draft.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("ff75d661-84b0-4bec-a166-c4368facf269")] - -// 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")] diff --git a/RiffChallengeDraft.Tests/RiffChallengeDraft.Tests.csproj b/RiffChallengeDraft.Tests/RiffChallengeDraft.Tests.csproj index 2cfd0ca..db8156c 100644 --- a/RiffChallengeDraft.Tests/RiffChallengeDraft.Tests.csproj +++ b/RiffChallengeDraft.Tests/RiffChallengeDraft.Tests.csproj @@ -1,96 +1,19 @@ - - - - Debug - AnyCPU - {FF75D661-84B0-4BEC-A166-C4368FACF269} - Library - Properties - riff_challenge_draft.Tests - riff-challenge-draft.Tests - v4.5.2 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - {DF09704F-4B67-4594-B545-053E3024F59B} - RiffChallengeDraft.Core - - - {970de1c6-a460-4622-b0bd-f8e21a52ea19} - RiffChallengeDraft - - - - - - - False - - - False - - - False - - - False - - - - - - - - \ No newline at end of file + + + + netcoreapp3.1 + + false + + + + + + + + + + + + + diff --git a/RiffChallengeDraft.sln b/RiffChallengeDraft.sln index b6d5a8b..5e9ce6f 100644 --- a/RiffChallengeDraft.sln +++ b/RiffChallengeDraft.sln @@ -1,19 +1,10 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RiffChallengeDraft", "RiffChallengeDraft\RiffChallengeDraft.csproj", "{970DE1C6-A460-4622-B0BD-F8E21A52EA19}" - ProjectSection(ProjectDependencies) = postProject - {DF09704F-4B67-4594-B545-053E3024F59B} = {DF09704F-4B67-4594-B545-053E3024F59B} - EndProjectSection +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RiffChallengeDraft", "RiffChallengeDraft\RiffChallengeDraft.csproj", "{27215FBF-AF77-48D4-8F24-5EC130A50CAF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RiffChallengeDraft.Tests", "RiffChallengeDraft.Tests\RiffChallengeDraft.Tests.csproj", "{FF75D661-84B0-4BEC-A166-C4368FACF269}" - ProjectSection(ProjectDependencies) = postProject - {970DE1C6-A460-4622-B0BD-F8E21A52EA19} = {970DE1C6-A460-4622-B0BD-F8E21A52EA19} - EndProjectSection +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RiffChallengeDraft.Core", "RiffChallengeDraft.Core\RiffChallengeDraft.Core.csproj", "{1BE5F820-4F45-46C6-9FCD-269011BC9B98}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RiffChallengeDraft.Core", "RiffChallengeDraft.Core\RiffChallengeDraft.Core.csproj", "{DF09704F-4B67-4594-B545-053E3024F59B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RiffChallengeDraft.Tests", "RiffChallengeDraft.Tests\RiffChallengeDraft.Tests.csproj", "{6EEE91DC-A6CC-405F-8510-DDB6A8B63751}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,20 +12,17 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {970DE1C6-A460-4622-B0BD-F8E21A52EA19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {970DE1C6-A460-4622-B0BD-F8E21A52EA19}.Debug|Any CPU.Build.0 = Debug|Any CPU - {970DE1C6-A460-4622-B0BD-F8E21A52EA19}.Release|Any CPU.ActiveCfg = Release|Any CPU - {970DE1C6-A460-4622-B0BD-F8E21A52EA19}.Release|Any CPU.Build.0 = Release|Any CPU - {FF75D661-84B0-4BEC-A166-C4368FACF269}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FF75D661-84B0-4BEC-A166-C4368FACF269}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FF75D661-84B0-4BEC-A166-C4368FACF269}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FF75D661-84B0-4BEC-A166-C4368FACF269}.Release|Any CPU.Build.0 = Release|Any CPU - {DF09704F-4B67-4594-B545-053E3024F59B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DF09704F-4B67-4594-B545-053E3024F59B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DF09704F-4B67-4594-B545-053E3024F59B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DF09704F-4B67-4594-B545-053E3024F59B}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE + {27215FBF-AF77-48D4-8F24-5EC130A50CAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {27215FBF-AF77-48D4-8F24-5EC130A50CAF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {27215FBF-AF77-48D4-8F24-5EC130A50CAF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {27215FBF-AF77-48D4-8F24-5EC130A50CAF}.Release|Any CPU.Build.0 = Release|Any CPU + {1BE5F820-4F45-46C6-9FCD-269011BC9B98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1BE5F820-4F45-46C6-9FCD-269011BC9B98}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1BE5F820-4F45-46C6-9FCD-269011BC9B98}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1BE5F820-4F45-46C6-9FCD-269011BC9B98}.Release|Any CPU.Build.0 = Release|Any CPU + {6EEE91DC-A6CC-405F-8510-DDB6A8B63751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6EEE91DC-A6CC-405F-8510-DDB6A8B63751}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6EEE91DC-A6CC-405F-8510-DDB6A8B63751}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6EEE91DC-A6CC-405F-8510-DDB6A8B63751}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/RiffChallengeDraft/App.config b/RiffChallengeDraft/App.config deleted file mode 100644 index 88fa402..0000000 --- a/RiffChallengeDraft/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/RiffChallengeDraft/Cli/ConsoleSpinner.cs b/RiffChallengeDraft/Cli/ConsoleSpinner.cs index c4f7788..b2ed727 100644 --- a/RiffChallengeDraft/Cli/ConsoleSpinner.cs +++ b/RiffChallengeDraft/Cli/ConsoleSpinner.cs @@ -22,7 +22,9 @@ public static void Turn() case 2: Console.Write("\\"); break; case 3: Console.Write("|"); break; } - Console.SetCursorPosition(Console.CursorLeft - 1, Console.CursorTop); + + var pos = Console.CursorLeft - 1 >= 0 ? Console.CursorLeft - 1 : 0; + Console.SetCursorPosition(pos, Console.CursorTop); } } } diff --git a/RiffChallengeDraft/Cli/DraftFacilitator.cs b/RiffChallengeDraft/Cli/DraftFacilitator.cs index 22b0f60..5d49e8f 100644 --- a/RiffChallengeDraft/Cli/DraftFacilitator.cs +++ b/RiffChallengeDraft/Cli/DraftFacilitator.cs @@ -1,5 +1,4 @@ -using RiffChallengeDraft.Cli; -using RiffChallengeDraft.Core.Entities; +using RiffChallengeDraft.Core.Entities; using RiffChallengeDraft.Core.Helpers; using System; using System.Collections.Generic; @@ -12,7 +11,7 @@ namespace RiffChallengeDraft.Cli { public class DraftFacilitator { - private string _logFilePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); + private string _logFilePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); private string _fileName; private string _absolutePath; private Genre? _weeklyWildcardGenre = null; @@ -31,7 +30,7 @@ public DraftFacilitator() WeeklyTheme = new WeeklyTheme(true); _initiatedDateTime = DateTime.Now; _fileName = "RCD-" + _initiatedDateTime.ToString("yyyy-MM-dd-hh-mm") + ".log"; // draft-2016-08-27-06-17.log - _absolutePath = _logFilePath + "\\" + _fileName; + _absolutePath = _logFilePath + Path.DirectorySeparatorChar + _fileName; } diff --git a/RiffChallengeDraft/Properties/AssemblyInfo.cs b/RiffChallengeDraft/Properties/AssemblyInfo.cs deleted file mode 100644 index 8bdf257..0000000 --- a/RiffChallengeDraft/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -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("riff-challenge-draft")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("riff-challenge-draft")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[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("970de1c6-a460-4622-b0bd-f8e21a52ea19")] - -// 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.5.0")] -[assembly: AssemblyFileVersion("1.0.5.0")] diff --git a/RiffChallengeDraft/RiffChallengeDraft.csproj b/RiffChallengeDraft/RiffChallengeDraft.csproj index 414bd61..ed8e1ce 100644 --- a/RiffChallengeDraft/RiffChallengeDraft.csproj +++ b/RiffChallengeDraft/RiffChallengeDraft.csproj @@ -1,120 +1,15 @@ - - - - - Debug - AnyCPU - {970DE1C6-A460-4622-B0BD-F8E21A52EA19} - Exe - Properties - RiffChallengeDraft - RiffChallengeDraft - v4.5.2 - 512 - true - false - C:\Deploy\RCD\ - true - Disk - false - Foreground - 7 - Days - false - false - false - RIff Challenge Draft - Robin Hanssen - true - 8 - 1.0.0.%2a - false - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - E227645D3BFA48F90CAFACFCB9DB1E8D8C5630DB - - - true - - - false - - - - - - - - - - - - - - - - - - - True - True - Texts.resx - - - - - - - - {df09704f-4b67-4594-b545-053e3024f59b} - RiffChallengeDraft.Core - - - - - False - Microsoft .NET Framework 4.5.2 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - - ResXFileCodeGenerator - Texts.Designer.cs - - - - - \ No newline at end of file + + + + Exe + netcoreapp3.1 + Robin Hovind + 2.0.0.0 + 2.0.0.0 + + + + + + +