From 01a014fc1a58aec38d42b68e06f4d319efb4bdfe Mon Sep 17 00:00:00 2001 From: blairvansant Date: Thu, 17 Aug 2017 09:24:33 -0500 Subject: [PATCH 1/2] Completed PirateSpeak code --- .../Properties/AssemblyInfo.cs | 2 ++ CodingChallenge.PirateSpeak/Solution.cs | 22 ++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CodingChallenge.PirateSpeak.Tests/Properties/AssemblyInfo.cs b/CodingChallenge.PirateSpeak.Tests/Properties/AssemblyInfo.cs index 06f4c0e..5c82345 100644 --- a/CodingChallenge.PirateSpeak.Tests/Properties/AssemblyInfo.cs +++ b/CodingChallenge.PirateSpeak.Tests/Properties/AssemblyInfo.cs @@ -13,6 +13,8 @@ [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] +[assembly: NUnit.Framework.Description("Tests")] + // 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 diff --git a/CodingChallenge.PirateSpeak/Solution.cs b/CodingChallenge.PirateSpeak/Solution.cs index 2c77075..ade8d28 100644 --- a/CodingChallenge.PirateSpeak/Solution.cs +++ b/CodingChallenge.PirateSpeak/Solution.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; namespace CodingChallenge.PirateSpeak @@ -7,7 +8,22 @@ public class Solution { public string[] GetPossibleWords(string jumble, string[] dictionary) { - throw new NotImplementedException(); + List PossibleWords = new List(); + + String UnJumbledWord = String.Concat(jumble.OrderBy(i => i)); // arrange jumble words in alpha. order + + foreach (var word in dictionary) + { + string dictionaryWord = String.Concat(word.OrderBy(i => i)); // arrange dic. word in alpha. order + + if (dictionaryWord == UnJumbledWord) // if the two are = + { + PossibleWords.Add(word); // add word to the list + } + } + return PossibleWords.ToArray(); // return list to array } - } -} \ No newline at end of file + } +} + + \ No newline at end of file From 3c4872a7c598f3e892b09c908b26b9eb2ecb663d Mon Sep 17 00:00:00 2001 From: Sam Shoultz Date: Thu, 17 Aug 2017 16:12:25 -0500 Subject: [PATCH 2/2] Fixed XUnit references, added Xunit.runner.visualstudio package, updated pirate test case --- .../CodingChallenge.FamilyTree.Tests.csproj | 32 ++++++++++++------- .../packages.config | 13 ++++---- .../CodingChallenge.PirateSpeak.Tests.csproj | 32 ++++++++++++------- .../PirateSpeakTests.cs | 2 +- .../packages.config | 11 ++++--- 5 files changed, 56 insertions(+), 34 deletions(-) diff --git a/CodingChallenge.FamilyTree.Tests/CodingChallenge.FamilyTree.Tests.csproj b/CodingChallenge.FamilyTree.Tests/CodingChallenge.FamilyTree.Tests.csproj index 04269a7..b613aff 100644 --- a/CodingChallenge.FamilyTree.Tests/CodingChallenge.FamilyTree.Tests.csproj +++ b/CodingChallenge.FamilyTree.Tests/CodingChallenge.FamilyTree.Tests.csproj @@ -1,5 +1,6 @@  + Debug @@ -9,8 +10,11 @@ Properties CodingChallenge.FamilyTree.Tests CodingChallenge.FamilyTree.Tests - v4.5 + v4.5.2 512 + + + true @@ -41,20 +45,17 @@ - ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll + ..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll True - - ..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll - True + + ..\packages\xunit.assert.2.2.0\lib\netstandard1.1\xunit.assert.dll - - ..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll - True + + ..\packages\xunit.extensibility.core.2.2.0\lib\netstandard1.1\xunit.core.dll - - ..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll - True + + ..\packages\xunit.extensibility.execution.2.2.0\lib\net452\xunit.execution.desktop.dll @@ -70,7 +71,16 @@ CodingChallenge.FamilyTree + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + +