public void updateDistanceAllNeighbor() { Neighbors.Clear(); DistanceInformation newNeighbor = new DistanceInformation(); for (int i = 0; i < others.Count; i++) { newNeighbor.Distance = calculateDistance(others[i].transform); newNeighbor.Address = others[i].GetComponentInChildren <IAddress>().Address; Neighbors.Add(newNeighbor); } }
public void TofController_GetTofResult_ReturnsExpectedTofResult(double tofSensorDistanceInMillimeters, double expectedDistanceInMillimeters, DistanceInformation expectedDistanceInformation) { // Arrange var tofSensor = new Mock <ITofSensor>(); tofSensor.Setup(_ => _.GetDistanceInMillimeters()).Returns(tofSensorDistanceInMillimeters); var testee = new TofController(tofSensor.Object); // Act var result = testee.GetTofResult(); // Assert result.DistanceInMillimeters.Should().Be(expectedDistanceInMillimeters); result.DistanceInformation.Should().Be(expectedDistanceInformation); }
public TofResult(double distanceInMillimeters, DistanceInformation distanceInformation) { this.DistanceInMillimeters = distanceInMillimeters; this.DistanceInformation = distanceInformation; }