public void Mass_SettingValue_ShouldStayZero() { var landscape = Landscape.Create(Size.Create(10, 10)); landscape.Mass = 42; landscape.Mass.Should().Be(0); }
public void Acceleration_SettingValue_ShouldStayZero() { var landscape = Landscape.Create(Size.Create(10, 10)); landscape.Acceleration = Vector.Create(5, 6); landscape.Acceleration.Should().BeEquivalentTo(Vector.Zero); }
public void Cords_SettingValue_ShouldStayZero() { var landscape = Landscape.Create(Size.Create(10, 10)); landscape.Cords = Vector.Create(5, 6); landscape.Cords.Should().BeEquivalentTo(Vector.Zero); }
public void IntersectsWith_IntersectingWithLandscape_ShouldThrowArgumentException() { Action a = () => { Landscape.Create(Size.Create(10, 10)) .IntersectsWith(Landscape.Create(Size.Create(10, 10))); }; a.Should().Throw <ArgumentException>(); }
public void Create_NormalSize_ShouldReturnEmptyFieldWithRightSize(Size size) { var sut = Landscape.Create(size); sut.Size.Should().BeEquivalentTo(size); for (var i = 0; i < size.Height; i++) { for (var j = 0; j < size.Width; j++) { sut.GetCell(i, j).Should().BeEquivalentTo(LandscapeCell.Empty); } } }
public void GetCellSetCell_WorkingWithValues_ShouldReturnRightValues() { var random = new Random(); var landscape = Landscape.Create(Size.Create(random.Next(10, 100), random.Next(10, 100))); var exceptedLandscape = new LandscapeCell[landscape.Size.Height, landscape.Size.Width]; for (var i = 0; i < landscape.Size.Height; i++) { for (var j = 0; j < landscape.Size.Width; j++) { exceptedLandscape[i, j] = random.Next(1, 2) == 1 ? LandscapeCell.Empty : LandscapeCell.Ground; landscape.SetCell(i, j, exceptedLandscape[i, j]); } } for (var i = 0; i < landscape.Size.Height; i++) { for (var j = 0; j < landscape.Size.Width; j++) { landscape.GetCell(i, j).Should().BeEquivalentTo(exceptedLandscape[i, j]); } } }