diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..1ff0c42
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3c4efe2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,261 @@
+## 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/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# 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
+project.fragment.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
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# 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
+nCrunchTemp_*
+
+# 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 database connection strings (with potential passwords) will be unencrypted
+#*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# 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
+# NuGet v3's project.json files produces more ignoreable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+
+# 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/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+node_modules/
+orleans.codegen.cs
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# 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/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush
+.cr/
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
\ No newline at end of file
diff --git a/MissingNumber/MissingNumber.sln b/MissingNumber/MissingNumber.sln
new file mode 100644
index 0000000..18da0d9
--- /dev/null
+++ b/MissingNumber/MissingNumber.sln
@@ -0,0 +1,33 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26228.12
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MissingNumber", "MissingNumber\MissingNumber.csproj", "{4A839C5C-A726-4FB4-AB95-D4817D287B99}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MissingNumberTests", "MissingNumberTests\MissingNumberTests.csproj", "{21A516FC-C655-481B-9D19-E97615701CD9}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C4A8CA9A-DCBA-445E-97A1-A604F4DB8108}"
+ ProjectSection(SolutionItems) = preProject
+ ..\README.md = ..\README.md
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4A839C5C-A726-4FB4-AB95-D4817D287B99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4A839C5C-A726-4FB4-AB95-D4817D287B99}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4A839C5C-A726-4FB4-AB95-D4817D287B99}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4A839C5C-A726-4FB4-AB95-D4817D287B99}.Release|Any CPU.Build.0 = Release|Any CPU
+ {21A516FC-C655-481B-9D19-E97615701CD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {21A516FC-C655-481B-9D19-E97615701CD9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {21A516FC-C655-481B-9D19-E97615701CD9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {21A516FC-C655-481B-9D19-E97615701CD9}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/MissingNumber/MissingNumber/App.config b/MissingNumber/MissingNumber/App.config
new file mode 100644
index 0000000..88fa402
--- /dev/null
+++ b/MissingNumber/MissingNumber/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MissingNumber/MissingNumber/App.xaml b/MissingNumber/MissingNumber/App.xaml
new file mode 100644
index 0000000..6e008ca
--- /dev/null
+++ b/MissingNumber/MissingNumber/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/MissingNumber/MissingNumber/App.xaml.cs b/MissingNumber/MissingNumber/App.xaml.cs
new file mode 100644
index 0000000..cd56d48
--- /dev/null
+++ b/MissingNumber/MissingNumber/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace MissingNumber
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/MissingNumber/MissingNumber/FileParser.cs b/MissingNumber/MissingNumber/FileParser.cs
new file mode 100644
index 0000000..e0f8f0a
--- /dev/null
+++ b/MissingNumber/MissingNumber/FileParser.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+
+namespace MissingNumber
+{
+ ///
+ /// Parses a file of the right format and creates NumberLine objects from it
+ ///
+ public class FileParser
+ {
+ ///
+ /// Parses a file with the correct format and returns a list of NumberLine objects
+ ///
+ /// Full path to the file to read
+ /// IList of NumberLine objects created from the file
+ /// Thrown if the file passed can not be located
+ public IList ParseFile(string filePath)
+ {
+ if (File.Exists(filePath))
+ {
+ return parseLines(File.ReadAllLines(filePath));
+ }
+ else
+ {
+ throw new FileNotFoundException($"Invalid file passed to FileParser, file {filePath} does not exist.");
+ }
+ }
+
+ private IList parseLines(string [] lines)
+ {
+ List numberLines = new List();
+ NumberLine tmp;
+ foreach (string line in lines.Where(l => !string.IsNullOrEmpty(l)))
+ {
+ tmp = parseLine(line);
+ if (tmp != null)
+ {
+ numberLines.Add(tmp);
+ }
+ }
+ return numberLines;
+ }
+
+ private NumberLine parseLine(string line)
+ {
+ try
+ {
+ return new NumberLine(line, ',');
+ }
+ catch (ArgumentException e)
+ {
+ return null;
+ }
+ }
+ }
+}
diff --git a/MissingNumber/MissingNumber/MainViewModel.cs b/MissingNumber/MissingNumber/MainViewModel.cs
new file mode 100644
index 0000000..e0b2ed4
--- /dev/null
+++ b/MissingNumber/MissingNumber/MainViewModel.cs
@@ -0,0 +1,32 @@
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+
+namespace MissingNumber
+{
+ ///
+ /// Simple ViewModel to control basic flow of application, not really a true view model but similiar in responsibility
+ ///
+ public class MainViewModel
+ {
+ private FileParser _parser = new FileParser();
+
+ ///
+ /// Results that correspond to the input. These are the missing Numbers
+ ///
+ public ObservableCollection Results { get; private set; } = new ObservableCollection();
+
+ ///
+ /// Takes a file from the user and finds all the missing numbers
+ ///
+ /// Location of the file to use
+ public void ReadFile(string fileLocation)
+ {
+ Results.Clear();
+ IList numLines = _parser.ParseFile(fileLocation);
+ foreach (NumberLine numLine in numLines)
+ {
+ Results.Add(numLine.MissingNumber);
+ }
+ }
+ }
+}
diff --git a/MissingNumber/MissingNumber/MainWindow.xaml b/MissingNumber/MissingNumber/MainWindow.xaml
new file mode 100644
index 0000000..56e1c4a
--- /dev/null
+++ b/MissingNumber/MissingNumber/MainWindow.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
diff --git a/MissingNumber/MissingNumber/MainWindow.xaml.cs b/MissingNumber/MissingNumber/MainWindow.xaml.cs
new file mode 100644
index 0000000..2c52878
--- /dev/null
+++ b/MissingNumber/MissingNumber/MainWindow.xaml.cs
@@ -0,0 +1,32 @@
+using Microsoft.Win32;
+using System.Windows;
+
+namespace MissingNumber
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ public MainWindow()
+ {
+ InitializeComponent();
+ ViewModel = new MainViewModel();
+ DataContext = ViewModel;
+ }
+
+ ///
+ /// View Model for this window
+ ///
+ public MainViewModel ViewModel { get; private set; }
+
+ private void SelectFileButtonSelected(object sender, RoutedEventArgs e)
+ {
+ OpenFileDialog fileSelector = new OpenFileDialog();
+ if (fileSelector.ShowDialog() == true)
+ {
+ ViewModel.ReadFile(fileSelector.FileName);
+ }
+ }
+ }
+}
diff --git a/MissingNumber/MissingNumber/MissingNumber.csproj b/MissingNumber/MissingNumber/MissingNumber.csproj
new file mode 100644
index 0000000..0c3ef57
--- /dev/null
+++ b/MissingNumber/MissingNumber/MissingNumber.csproj
@@ -0,0 +1,100 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {4A839C5C-A726-4FB4-AB95-D4817D287B99}
+ WinExe
+ MissingNumber
+ MissingNumber
+ v4.5.2
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+
+
+ MainWindow.xaml
+ Code
+
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MissingNumber/MissingNumber/NumberLine.cs b/MissingNumber/MissingNumber/NumberLine.cs
new file mode 100644
index 0000000..8759b56
--- /dev/null
+++ b/MissingNumber/MissingNumber/NumberLine.cs
@@ -0,0 +1,85 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace MissingNumber
+{
+ ///
+ /// Class that represents a sequential list of numbers and provides the ability to detect which number is missing
+ ///
+ public class NumberLine
+ {
+ private int _sum = 0;
+
+ ///
+ /// Creats a new NumberLine object
+ ///
+ /// Thrown if the string given is not of the correct format
+ public NumberLine(string line, char delimiter)
+ {
+ Min = int.MaxValue;
+ Max = int.MinValue;
+ Numbers = populateNumbers(line, delimiter);
+ MissingNumber = getMissingNumber();
+ }
+
+ ///
+ /// Collection of Numbers generated, unordered
+ ///
+ public IReadOnlyList Numbers { get; private set; }
+
+ ///
+ /// Smallest Number in sequence
+ ///
+ public int Min { get; private set; }
+
+ ///
+ /// Largest Number in sequence
+ ///
+ public int Max { get; private set; }
+
+ ///
+ /// The Number missing from the Number sequence
+ ///
+ public int MissingNumber { get; private set; }
+
+ private int getMissingNumber()
+ {
+ int expectedSum = (Numbers.Count + 1) * (Min + Max) / 2;
+ return expectedSum - _sum;
+ }
+
+ private IReadOnlyList populateNumbers(string line, char delimiter)
+ {
+ string[] nums = line.Split(delimiter);
+ return new List(nums.Select(n => intFromString(n)));
+ }
+
+ private int intFromString(string s)
+ {
+ try
+ {
+ int newNum = int.Parse(s);
+ updateMinMax(newNum);
+ _sum += newNum;
+ return newNum;
+ }
+ catch(Exception e)
+ {
+ throw new ArgumentException($"Invalid string line passed to NumberLine, {s} can not convert to a number.", e);
+ }
+ }
+
+ private void updateMinMax(int num)
+ {
+ if (num < Min)
+ {
+ Min = num;
+ }
+ if (num > Max)
+ {
+ Max = num;
+ }
+ }
+ }
+}
diff --git a/MissingNumber/MissingNumber/Properties/AssemblyInfo.cs b/MissingNumber/MissingNumber/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..d92c070
--- /dev/null
+++ b/MissingNumber/MissingNumber/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// 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("MissingNumber")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MissingNumber")]
+[assembly: AssemblyCopyright("Copyright © 2018")]
+[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)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// 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/MissingNumber/MissingNumber/Properties/Resources.Designer.cs b/MissingNumber/MissingNumber/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..d90287f
--- /dev/null
+++ b/MissingNumber/MissingNumber/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MissingNumber.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MissingNumber.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/MissingNumber/MissingNumber/Properties/Resources.resx b/MissingNumber/MissingNumber/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/MissingNumber/MissingNumber/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/MissingNumber/MissingNumber/Properties/Settings.Designer.cs b/MissingNumber/MissingNumber/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..e87de8d
--- /dev/null
+++ b/MissingNumber/MissingNumber/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MissingNumber.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/MissingNumber/MissingNumber/Properties/Settings.settings b/MissingNumber/MissingNumber/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/MissingNumber/MissingNumber/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MissingNumber/MissingNumberTests/DataFiles/badsamples.txt b/MissingNumber/MissingNumberTests/DataFiles/badsamples.txt
new file mode 100644
index 0000000..290f784
--- /dev/null
+++ b/MissingNumber/MissingNumberTests/DataFiles/badsamples.txt
@@ -0,0 +1,3 @@
+4,1,2
+aaaa,see
+--,-
\ No newline at end of file
diff --git a/MissingNumber/MissingNumberTests/DataFiles/blank.txt b/MissingNumber/MissingNumberTests/DataFiles/blank.txt
new file mode 100644
index 0000000..5f28270
--- /dev/null
+++ b/MissingNumber/MissingNumberTests/DataFiles/blank.txt
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/MissingNumber/MissingNumberTests/DataFiles/novalid.txt b/MissingNumber/MissingNumberTests/DataFiles/novalid.txt
new file mode 100644
index 0000000..a9456a9
--- /dev/null
+++ b/MissingNumber/MissingNumberTests/DataFiles/novalid.txt
@@ -0,0 +1,3 @@
+sdfsdfsd
+aaaa,see
+--,-
\ No newline at end of file
diff --git a/MissingNumber/MissingNumberTests/DataFiles/samples.txt b/MissingNumber/MissingNumberTests/DataFiles/samples.txt
new file mode 100644
index 0000000..04e45e8
--- /dev/null
+++ b/MissingNumber/MissingNumberTests/DataFiles/samples.txt
@@ -0,0 +1,12 @@
+1,2,3,4,5,6,7,8,9,10,12
+
+24,26,27,29,28
+
+1,2,4,5
+
+99,100,101,102,103,104,105,107
+
+
+
+
+109,105,107,108,106,110,112,111,118,116,115,114,117
\ No newline at end of file
diff --git a/MissingNumber/MissingNumberTests/DataFiles/wrongformat.pdf b/MissingNumber/MissingNumberTests/DataFiles/wrongformat.pdf
new file mode 100644
index 0000000..efb8331
Binary files /dev/null and b/MissingNumber/MissingNumberTests/DataFiles/wrongformat.pdf differ
diff --git a/MissingNumber/MissingNumberTests/FileParserTests.cs b/MissingNumber/MissingNumberTests/FileParserTests.cs
new file mode 100644
index 0000000..931510e
--- /dev/null
+++ b/MissingNumber/MissingNumberTests/FileParserTests.cs
@@ -0,0 +1,75 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using MissingNumber;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+
+namespace MissingNumberTests
+{
+ [TestClass]
+ public class FileParserTests
+ {
+ [TestMethod]
+ public void FileParser_ParseFile_ValidTest()
+ {
+ FileParser target = new FileParser();
+ IList expected = new List { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12 };
+ IReadOnlyList actual = target.ParseFile(Path.Combine(Directory.GetCurrentDirectory(), @"DataFiles\samples.txt"))[0].Numbers;
+ CollectionAssert.AreEqual((ICollection)expected, (ICollection)actual);
+ }
+
+ [TestMethod]
+ public void FileParser_ParseFile_IgnoreEmptyLinesTest()
+ {
+ FileParser target = new FileParser();
+ int expected = 5;
+ int actual = target.ParseFile(Path.Combine(Directory.GetCurrentDirectory(), @"DataFiles\samples.txt")).Count;
+ Assert.AreEqual(expected, actual);
+ }
+
+ [TestMethod]
+ public void FileParser_ParseFile_BadDataTest()
+ {
+ FileParser target = new FileParser();
+ int expected = 1;
+ int actual = target.ParseFile(Path.Combine(Directory.GetCurrentDirectory(), @"DataFiles\badsamples.txt")).Count;
+ Assert.AreEqual(expected, actual);
+ }
+
+ [TestMethod]
+ public void FileParser_ParseFile_BadData_ValidAnswerTest()
+ {
+ FileParser target = new FileParser();
+ int expected = 3;
+ int actual = target.ParseFile(Path.Combine(Directory.GetCurrentDirectory(), @"DataFiles\badsamples.txt"))[0].MissingNumber;
+ Assert.AreEqual(expected, actual);
+ }
+
+ [TestMethod]
+ public void FileParser_ParseFile_FileBlankTest()
+ {
+ FileParser target = new FileParser();
+ int expected = 0;
+ int actual = target.ParseFile(Path.Combine(Directory.GetCurrentDirectory(), @"DataFiles\blank.txt")).Count;
+ Assert.AreEqual(expected, actual);
+ }
+
+
+ [TestMethod]
+ public void FileParser_ParseFile_NoValidDataTest()
+ {
+ FileParser target = new FileParser();
+ int expected = 0;
+ int actual = target.ParseFile(Path.Combine(Directory.GetCurrentDirectory(), @"DataFiles\novalid.txt")).Count;
+ Assert.AreEqual(expected, actual);
+ }
+
+ [TestMethod]
+ [ExpectedException(typeof(FileNotFoundException))]
+ public void FileParser_ParseFile_FileNotFoundTest()
+ {
+ FileParser target = new FileParser();
+ target.ParseFile("fileThatDoesntExist.txt");
+ }
+ }
+}
diff --git a/MissingNumber/MissingNumberTests/MainViewModelTests.cs b/MissingNumber/MissingNumberTests/MainViewModelTests.cs
new file mode 100644
index 0000000..57ae34c
--- /dev/null
+++ b/MissingNumber/MissingNumberTests/MainViewModelTests.cs
@@ -0,0 +1,36 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using MissingNumber;
+using System.IO;
+
+namespace MissingNumberTests
+{
+ [TestClass]
+ public class MainViewModelTests
+ {
+ [TestMethod]
+ public void MainViewModel_ReadFile_ResultsTest()
+ {
+ MainViewModel target = new MainViewModel();
+ target.ReadFile(Path.Combine(Directory.GetCurrentDirectory(), @"DataFiles\badsamples.txt"));
+ int expected = 1;
+ Assert.AreEqual(expected, target.Results.Count);
+ }
+
+ [TestMethod]
+ public void MainViewModel_ReadFile_ClearsResults()
+ {
+ MainViewModel target = new MainViewModel();
+ target.ReadFile(Path.Combine(Directory.GetCurrentDirectory(), @"DataFiles\badsamples.txt"));
+ target.ReadFile(Path.Combine(Directory.GetCurrentDirectory(), @"DataFiles\samples.txt"));
+ int expected = 5;
+ Assert.AreEqual(expected, target.Results.Count);
+ }
+
+ [TestMethod]
+ public void MainViewModel_ReadFile_BadFileFormat()
+ {
+ MainViewModel target = new MainViewModel();
+ target.ReadFile(Path.Combine(Directory.GetCurrentDirectory(), @"DataFiles\wrongformat.pdf"));
+ }
+ }
+}
diff --git a/MissingNumber/MissingNumberTests/MissingNumberTests.csproj b/MissingNumber/MissingNumberTests/MissingNumberTests.csproj
new file mode 100644
index 0000000..06b6bd7
--- /dev/null
+++ b/MissingNumber/MissingNumberTests/MissingNumberTests.csproj
@@ -0,0 +1,92 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {21A516FC-C655-481B-9D19-E97615701CD9}
+ Library
+ Properties
+ MissingNumberTests
+ MissingNumberTests
+ v4.5.2
+ 512
+ {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 15.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
+
+
+
+ ..\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll
+
+
+ ..\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
+
+
+
+
+
+
+
+
+
+
+
+
+ Always
+
+
+
+
+
+ {4a839c5c-a726-4fb4-ab95-d4817d287b99}
+ MissingNumber
+
+
+
+
+ Always
+
+
+ Always
+
+
+ Always
+
+
+ Always
+
+
+
+
+
+
+ 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}.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MissingNumber/MissingNumberTests/NumberLineTests.cs b/MissingNumber/MissingNumberTests/NumberLineTests.cs
new file mode 100644
index 0000000..dd60578
--- /dev/null
+++ b/MissingNumber/MissingNumberTests/NumberLineTests.cs
@@ -0,0 +1,75 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using MissingNumber;
+using System.Collections.Generic;
+using System.Collections;
+using System;
+
+namespace MissingNumberTests
+{
+ [TestClass]
+ public class NumberLineTests
+ {
+ [TestMethod]
+ public void NumberLine_Constructor_ValidDataTest()
+ {
+ NumberLine target = new NumberLine("1,2,4,5", ',');
+ IList expected = new List { 1, 2, 4, 5 };
+ CollectionAssert.AreEqual((ICollection)expected, (ICollection)target.Numbers);
+ }
+
+ [TestMethod]
+ public void NumberLine_Constructor_WithSpacesTest()
+ {
+ NumberLine target = new NumberLine("1, 2 , 4 , 5", ',');
+ IList expected = new List { 1, 2, 4, 5 };
+ CollectionAssert.AreEqual((ICollection)expected, (ICollection)target.Numbers);
+ }
+
+ [TestMethod]
+ [ExpectedException(typeof(ArgumentException))]
+ public void NumberLine_Constructor_InvalidStringTest()
+ {
+ NumberLine target = new NumberLine("bad data", ',');
+ }
+
+ [TestMethod]
+ public void NumberLine_FindMissingNumber_ValidTest()
+ {
+ NumberLine target = new NumberLine("1,2,4,5", ',');
+ int expected = 3;
+ Assert.AreEqual(expected, target.MissingNumber);
+ }
+
+ [TestMethod]
+ public void NumberLine_FindMissingNumber_ValidTest2()
+ {
+ NumberLine target = new NumberLine("1,2,3,4,5,6,7,8,9,10,12", ',');
+ int expected = 11;
+ Assert.AreEqual(expected, target.MissingNumber);
+ }
+
+ [TestMethod]
+ public void NumberLine_FindMissingNumber_ValidTest3()
+ {
+ NumberLine target = new NumberLine("24,26,27,29,28", ',');
+ int expected = 25;
+ Assert.AreEqual(expected, target.MissingNumber);
+ }
+
+ [TestMethod]
+ public void NumberLine_FindMissingNumber_ValidTest4()
+ {
+ NumberLine target = new NumberLine("99,100,101,102,103,104,105,107", ',');
+ int expected = 106;
+ Assert.AreEqual(expected, target.MissingNumber);
+ }
+
+ [TestMethod]
+ public void NumberLine_FindMissingNumber_ValidTest5()
+ {
+ NumberLine target = new NumberLine("109,105,107,108,106,110,112,111,118,116,115,114,117", ',');
+ int expected = 113;
+ Assert.AreEqual(expected, target.MissingNumber);
+ }
+ }
+}
diff --git a/MissingNumber/MissingNumberTests/Properties/AssemblyInfo.cs b/MissingNumber/MissingNumberTests/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..c09eea1
--- /dev/null
+++ b/MissingNumber/MissingNumberTests/Properties/AssemblyInfo.cs
@@ -0,0 +1,20 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("MissingNumberTests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("MissingNumberTests")]
+[assembly: AssemblyCopyright("Copyright © 2018")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+
+[assembly: Guid("21a516fc-c655-481b-9d19-e97615701cd9")]
+
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/MissingNumber/MissingNumberTests/packages.config b/MissingNumber/MissingNumberTests/packages.config
new file mode 100644
index 0000000..1ab7218
--- /dev/null
+++ b/MissingNumber/MissingNumberTests/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file