コード例 #1
0
    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);
        }
    }
コード例 #2
0
        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);
        }
コード例 #3
0
 public TofResult(double distanceInMillimeters, DistanceInformation distanceInformation)
 {
     this.DistanceInMillimeters = distanceInMillimeters;
     this.DistanceInformation   = distanceInformation;
 }