Example #1
0
		public void JumpCounts(string fromName, string toName, int expectedJumps)
		{
			var fields = GetFields();
			var jumpCountTable = new JumpCountTable(_solarSystems);
			var from = (SolarSystem)fields[string.Concat("_", fromName)].GetValue(this);
			var to = (SolarSystem)fields[string.Concat("_", toName)].GetValue(this);

			Assert.That(jumpCountTable.GetJumpCount(from, to), Is.EqualTo(expectedJumps));
		}
Example #2
0
		public void JumpCounts()
		{
			var jumpCountTable = new JumpCountTable(_solarSystems);
			var directConnections = jumpCountTable.Table.ToDictionary(x => x.SolarSystem);

			Assert.That(directConnections[_a].SolarSystem, Is.EqualTo(_a));
			Assert.That(directConnections[_a].DirectConnections.Count, Is.EqualTo(2));
			Assert.That(directConnections[_a].DirectConnections[0].SolarSystem, Is.EqualTo(_b));
			Assert.That(directConnections[_a].DirectConnections[1].SolarSystem, Is.EqualTo(_d));
			Assert.That(directConnections[_a].GetJumpCount(_b), Is.EqualTo(1));
			Assert.That(directConnections[_a].GetJumpCount(_e), Is.EqualTo(2));
			Assert.That(directConnections[_a].GetJumpCount(_f), Is.EqualTo(3));

			Assert.That(jumpCountTable.GetJumpCount(_e, _d), Is.EqualTo(1));
			Assert.That(jumpCountTable.GetJumpCount(_e, _f), Is.EqualTo(3));
			Assert.That(jumpCountTable.GetJumpCount(_e, _c), Is.EqualTo(2));
		}