public void Power_at_position_should_identify_when_a_station_is_too_far_away_from_a_position_to_supply_power() { var linkStation = new LinkStation(new Position(0, 0), 2); var powerAtPosition = linkStation.PowerAtPosition(new Position(0, 3)); Assert.AreEqual(0, powerAtPosition); }
public void Power_at_position_should_adjust_the_available_power_if_the_position_is_not_at_the_station() { var linkStation = new LinkStation(new Position(0, 0), 2); var powerAtPosition = linkStation.PowerAtPosition(new Position(0, 1)); Assert.AreEqual(1, powerAtPosition); }
public void Power_at_position_should_return_the_square_of_the_reach_if_the_position_is_at_the_station() { var linkStation = new LinkStation(new Position(2, 2), 2); var powerAtPosition = linkStation.PowerAtPosition(new Position(2, 2)); Assert.AreEqual(4, powerAtPosition); }
public void TestCalculatePower() { //Arrange var station = new LinkStation(new Point(18, 18), 10); var p1 = new Point(15, 10); //Act var power = station.CalculatePowerFrom(p1); //Assert Assert.Equal(2.1199, power); //Arrange station = new LinkStation(new Point(0, 0), 10); //Act power = station.CalculatePowerFrom(p1); //Assert Assert.Equal(0, power); }
public void Power_at_position_should_throw_argument_exception_if_no_position_supplied() { var linkStation = new LinkStation(new Position(0, 0), 1); linkStation.PowerAtPosition(null); }
public void Link_station_constructor_should_create_a_new_link_station_if_position_supplied() { var linkStation = new LinkStation(new Position(0, 0), 0); Assert.IsNotNull(linkStation); }
public void Link_station_constructor_should_throw_argument_exception_if_no_position_supplied() { var linkStation = new LinkStation(null, 0); }