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 System; | |
using System.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace FizzBuzz | |
{ | |
[TestClass] | |
public class FizzBuzzerTests | |
{ | |
private static void AssertThat(string expected, int value) |
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 System.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace CoinChanger | |
{ | |
[TestClass] | |
public class CoinChangerTests | |
{ | |
[TestMethod] | |
public void GivenZeroWithNoCoins_ItMustReturnEmptyArry() |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace CoinChangerKata | |
{ | |
[TestClass] | |
public class CoinChangerTests | |
{ |
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 System; | |
using System.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace CoinChanger | |
{ | |
[TestClass] | |
public class CoinChangerTests | |
{ | |
[TestMethod] |
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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace CoinChanger | |
{ | |
[TestClass] | |
public class CoinChangerTests | |
{ |
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 System.Collections.Generic; | |
using System.Linq; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace RomanNumerals | |
{ | |
[TestClass] | |
public class RomanNumeralTests | |
{ | |
[TestMethod] |
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
var inf = Enumerable.Range(0, int.MaxValue); | |
var fizzes = inf.Select(x => x%3 == 0 ? “Fizz” : “”); | |
var buzzes = inf.Select(x => x%5 == 0 ? “Buzz” : “”); | |
var numbers = inf.Select(x => x.ToString()); | |
var fizzbuzzer = | |
fizzes | |
.Zip(buzzes, (f, b) => f + b) | |
.Zip(numbers, (fb, s) => fb == “” ? s : fb); |
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
(map + [1 2 3] [10 20 30]) | |
;;(11 22 33) | |
(map + [1 2] [10 20 30]) | |
;;(11 22) | |
(map + [1 2 3] [10 20]) | |
;;(11 22) |
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
(mapcat identity [[1 2 3 4] [20 10]]) | |
;;(1 2 3 4 20 10) |
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
(mapcat #(map inc %) [[1 2 3 4] [20 10]]) | |
;; (2 3 4 5 21 11) | |
(map inc | |
(mapcat identity [[1 2 3 4] [20 10]])) | |
;;(2 3 4 5 21 11) | |
(->> |