public void WhenStringItsUpperHSpaceUpperH() { TransformKata transformation = new TransformKata(); string input = "H H"; Assert.That(transformation.LowerPack(input), Is.EqualTo("hh")); }
public void WhenStringItsSpaceAndHReturnSpaceAndH() { TransformKata transformation = new TransformKata(); string input = " h"; Assert.That(transformation.LowerPack(input), Is.EqualTo(" h")); }
public void WhenStringEmptyReturnStringEmpty() { TransformKata transformation = new TransformKata(); string input = ""; Assert.That(transformation.LowerPack(input), Is.Empty); }
public void WhenStringNullThrowArgumentNullException() { //Arrange TransformKata transformation = new TransformKata(); string input = null; //Act //Assert Assert.That(() => transformation.LowerPack(input), Throws.ArgumentNullException); }
List <double> MeasureTimes() { TransformKata transformation = new TransformKata(); List <double> MeasuredTimes = new List <double>(); Stopwatch sw = new Stopwatch(); string lastInput = "HH hh OO oo LL ll AA aaHH hh OO oo LL ll AA aa"; for (int i = 0; i < 22; i++) { lastInput += lastInput; sw = Stopwatch.StartNew(); transformation.LowerPack(lastInput); sw.Stop(); MeasuredTimes.Add(sw.Elapsed.TotalMilliseconds); } return(MeasuredTimes); }