public void Example1() { double expected = 2.794208684; double actual = Math.Round(challenge.GetResult("122333444455555666666777777788888888"), decimalPlaces); Assert.AreEqual(expected, actual); }
public void Example1() { var expected = "ullyzi"; var actual = challenge.GetResult("foobar"); Assert.AreEqual(expected, actual); }
public void Example1() { string[] lines = new string[] { "3", "1 2", "1 3" }; int[] expected = { 2, 1, 1 }; int[] actual = challenge.GetResult(lines); CollectionAssert.AreEqual(expected, actual); }
public void Example1() { string input = "tacocat"; bool expected = true; bool actual = challenge.GetResult(input); Assert.AreEqual(expected, actual); }
public void Example1() { int[] input = new int[9] { 8, 1, 6, 3, 5, 7, 4, 9, 2 }; var expected = true; var actual = challenge.GetResult(input); Assert.AreEqual(expected, actual); }
public void Example1() { e260_Garage_Door.Actions[] commands = new e260_Garage_Door.Actions[] { e260_Garage_Door.Actions.Click, e260_Garage_Door.Actions.Wait, e260_Garage_Door.Actions.Click, e260_Garage_Door.Actions.Click, e260_Garage_Door.Actions.Click, e260_Garage_Door.Actions.Click, e260_Garage_Door.Actions.Click, e260_Garage_Door.Actions.Wait, }; int[] expected = new int[] { e260_Garage_Door.STATE_CLOSED, e260_Garage_Door.STATE_OPENING, e260_Garage_Door.STATE_OPEN, e260_Garage_Door.STATE_CLOSING, e260_Garage_Door.STATE_STOPPEDWHILECLOSING, e260_Garage_Door.STATE_OPENING, e260_Garage_Door.STATE_STOPPEDWHILEOPENING, e260_Garage_Door.STATE_CLOSING, e260_Garage_Door.STATE_CLOSED }; int[] actual = challenge.GetResult(commands); CollectionAssert.AreEqual(expected, actual); }
public void Example1() { string[] lines = { "5", "X--X-", "-----", "-----", "-----", "---X-" }; int expected = 9; int actual = challenge.GetResult(lines); Assert.AreEqual(expected, actual); }
public void Example1() { string input = "PQAREIOURSTHGWIOAE_"; Dictionary <char, int> expected = new Dictionary <char, int>() { { 'E', 10 }, { 'A', 7 }, { 'I', 7 }, { 'N', 6 }, { 'O', 6 }, { 'T', 5 }, { 'D', 4 }, { 'L', 4 }, { 'R', 4 }, { 'S', 3 }, { 'U', 3 }, { 'B', 2 }, { 'C', 2 }, { 'F', 2 }, { 'G', 2 }, { 'M', 2 }, { 'V', 2 }, { 'Y', 2 }, { 'H', 1 }, { 'J', 1 }, { 'K', 1 }, { 'P', 1 }, { 'W', 1 }, { 'X', 1 }, { 'Z', 1 }, { '_', 1 }, { 'Q', 0 } }; var orderedExpected = expected.OrderBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value); Dictionary <char, int> actual = challenge.GetResult(input); CollectionAssert.AreEqual(orderedExpected, actual); }
public void Example1() { string[] lines = new string[] { " ", "VAR I", " FOR I=1 TO 31", " IF !(I MOD 3) THEN", " PRINT \"FIZZ\"", " ENDIF", " IF !(I MOD 5) THEN", " PRINT \"BUZZ\"", " ENDIF", " IF(I MOD 3) && (I MOD 5) THEN", " PRINT \"FIZZBUZZ\"", " ENDIF", " NEXT", }; string[] expected = new string[] { "VAR I", "FOR I=1 TO 31", " IF !(I MOD 3) THEN", " PRINT \"FIZZ\"", " ENDIF", " IF !(I MOD 5) THEN", " PRINT \"BUZZ\"", " ENDIF", " IF(I MOD 3) && (I MOD 5) THEN", " PRINT \"FIZZBUZZ\"", " ENDIF", "NEXT", }; string[] actual = challenge.GetResult(lines); CollectionAssert.AreEqual(expected, actual); }