public void Position_20And5OnA20x5Matrix_Is99() { var items = new StageItemBuilder().WithWidth(20).WithHeight(5).Build(); var sut = new ListMatrix(items, 20, 5); Assert.Equal(99, sut.Position(20, 5)); }
public static IMap Create(IEnumerable <char> mapItems, int width, int height) { var matrix = new ListMatrix(mapItems, width, height); var map = new Map(matrix); return(map); }
public void Position_3And2OnA3x2Matrix_Is6() { var items = new StageItemBuilder().WithWidth(3).WithHeight(2).Build(); var sut = new ListMatrix(items, 3, 2); Assert.Equal(5, sut.Position(3, 2)); }
private static ListMatrix ListMatrix10x10() { var items = new StageItemBuilder().Build(); var sut = new ListMatrix(items); return(sut); }
public void ToString_IsStillAwesome() { var items = new StageItemBuilder().WithWidth(20).WithHeight(5).Build(); var sut = new ListMatrix(items, 20, 5); var result = sut.ToString(); Assert.NotEmpty(result); }
public void ElementAt_EmtpyList_ThrowsArgumentOutOfRangeException() { var sut = new ListMatrix(new List <char>(), 0, 0); Assert.Throws <ArgumentOutOfRangeException>(() => sut.ElementAt(1, 1)); }
public StageItemBuilder WithStartPosition(int x, int y) { _startPosition = ListMatrix.Position(x, y, _width, NumberItems); return(this); }