Last active
May 3, 2018 13:03
-
-
Save dcecile/614ef9a4d4faa623144bd03856916597 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using NUnit.Framework; | |
| using NUnitLite; | |
| using System; | |
| using System.Reflection; | |
| using System.Linq; | |
| public static class Solution | |
| { | |
| public static int Solve() => | |
| (new[] { 1, 2, 3}).Sum(x => x * 2); | |
| } | |
| [TestFixture] | |
| public class Fixture | |
| { | |
| [Test] | |
| public void Positive() | |
| { | |
| var sum = Solution.Solve(); | |
| Console.WriteLine($"Hello, {1 + 1} {sum}"); | |
| Assert.That(sum, Is.EqualTo(4)); | |
| } | |
| [Test] | |
| public void Negative() | |
| { | |
| var sum = Solution.Solve(); | |
| Assert.That(sum, Is.EqualTo(4)); | |
| } | |
| } | |
| public static class Runner | |
| { | |
| public static int Main(string[] args) | |
| { | |
| var autoRun = new AutoRun(Assembly.GetCallingAssembly()); | |
| return autoRun.Execute(new string[] { "--labels=All" }); | |
| } | |
| } | |
| /* | |
| https://coderpad.io/sandbox | |
| https://docs.microsoft.com/en-ca/dotnet/api/system.linq.enumerable?view=netframework-4.7.1 | |
| https://docs.microsoft.com/en-ca/dotnet/api/system.string?view=netframework-4.7.1 | |
| https://docs.microsoft.com/en-ca/dotnet/api/system.collections.generic.dictionary-2?view=netframework-4.7.1 | |
| https://docs.microsoft.com/en-ca/dotnet/api/system.math?view=netframework-4.7.1 | |
| https://github.com/nunit/docs/wiki/Constraints | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment