protected override void Arrange() { _rndMock = new Mock<IRnd>(); _rndMock.Setup(r => r.NextX()).Returns(-50); _rndMock.Setup(r => r.NextY()).Returns(-50); _worldMatrix = new WorldMatrix(); _worldMatrix.Notify(new GameTime(new DateTime(2014, 2, 23, 20, 0, 0, 0), 100)); _monster = new FastMonster(_worldMatrix, _rndMock.Object); _worldMatrix.Add(_oldLocation, _monster); }
protected override void Arrange() { _rndMock = new Mock<IRnd>(); _rndMock.Setup(r => r.NextX()).Returns(50); _rndMock.Setup(r => r.NextY()).Returns(50); _worldMatrix = new WorldMatrix(); _worldMatrix.Notify(new GameTime(new DateTime(2014, 2, 23, 20, 0, 0, 0), 100)); _monster = new Monster1x1(_worldMatrix, _rndMock.Object); _worldMatrix.Add(_oldLocation, _monster); var locationOfMonster = _worldMatrix.GetLocationOf(_monster); Assert.IsNotNull(locationOfMonster); _oldDistance = Calculator.CalculateDistance(locationOfMonster.Value, _monster.NextDestination); }
protected override void Arrange() { _rndMock = new Mock<IRnd>(); _rndMock.Setup(r => r.NextX()).Returns(0); _rndMock.Setup(r => r.NextY()).Returns(0); _worldMatrix = new WorldMatrix(); _worldMatrix.Notify(new GameTime(new DateTime(2014, 2, 23, 20, 0, 0, 0), 100)); _monster1 = new Monster1x1(_worldMatrix, _rndMock.Object); _monster2 = new Monster1x1(_worldMatrix, _rndMock.Object); _worldMatrix.Add(_oldLocation1, _monster1); _worldMatrix.Add(_oldLocation2, _monster2); //we need a first notify in order to have a baseline _worldMatrix.Notify(new GameTime(new DateTime(2014, 2, 23, 20, 0, 0, 100), 100)); }
protected override void Arrange() { _worldMatrix = new WorldMatrix(); _theMonster = new Monster1x1(_worldMatrix, new Rnd(200, 200)); _anotherMonster = new Monster1x1(_worldMatrix, new Rnd(200, 200)); }
private double GetDistance(Monster monster) { var locationOfMonster = _worldMatrix.GetLocationOf(monster); Assert.IsNotNull(locationOfMonster); return Calculator.CalculateDistance(locationOfMonster.Value, monster.NextDestination); }