From d4f8cf6e06f260ebbb9244e3f1ad8497c35ade63 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 13 Jul 2017 14:03:30 +0200 Subject: [PATCH] Added gadget --- PullRequestSandbox/Gadget.cs | 27 ++++++++++++++++++++ PullRequestSandbox/Guard.cs | 19 ++++++++++++++ PullRequestSandbox/PullRequestSandbox.csproj | 2 ++ 3 files changed, 48 insertions(+) create mode 100644 PullRequestSandbox/Gadget.cs create mode 100644 PullRequestSandbox/Guard.cs diff --git a/PullRequestSandbox/Gadget.cs b/PullRequestSandbox/Gadget.cs new file mode 100644 index 0000000..7460af8 --- /dev/null +++ b/PullRequestSandbox/Gadget.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PullRequestSandbox +{ + class Gadget + { + Dictionary values = new Dictionary(); + + public void SetBlerp(string value) + { + Guard.NotNull(value, nameof(value)); + + values["blerp"] = value; + } + + public void SetBloop(string value) + { + Guard.NotNull(value, nameof(value)); + + values["bloop"] = value; + } + } +} diff --git a/PullRequestSandbox/Guard.cs b/PullRequestSandbox/Guard.cs new file mode 100644 index 0000000..8bb01a9 --- /dev/null +++ b/PullRequestSandbox/Guard.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PullRequestSandbox +{ + static class Guard + { + public static void NotNull(T value, string paramName) + { + if (value == null) + { + throw new ArgumentNullException(paramName); + } + } + } +} diff --git a/PullRequestSandbox/PullRequestSandbox.csproj b/PullRequestSandbox/PullRequestSandbox.csproj index bb80d26..918d31d 100644 --- a/PullRequestSandbox/PullRequestSandbox.csproj +++ b/PullRequestSandbox/PullRequestSandbox.csproj @@ -43,6 +43,8 @@ + +