public void ComparerTest_FirstObservationIsNull_ResultIsMinus1() { // Arange var sut = new ObservationPointComparer <IEnergyObservation>(); var energyMock = new Mock <IEnergyObservation>(); // Act var actualResult = sut.Compare(null, energyMock.Object); // Assert Assert.Equal(-1, actualResult); }
public void ComparerTest_SecondObservationIsNull_ResultIs1() { // Arange var sut = new ObservationPointComparer <IEnergyObservation>(); var energyMock = new Mock <IEnergyObservation>(); // Act var actualResult = sut.Compare(energyMock.Object, null); // Assert Assert.Equal(1, actualResult); }
public void ComparerTest_ObservationReferencesAreEqual_ResultIs0() { // Arange var sut = new ObservationPointComparer <IEnergyObservation>(); var energyMock1 = new Mock <IEnergyObservation>(); var energyMock2 = energyMock1; // Act var actualResult = sut.Compare(energyMock1.Object, energyMock2.Object); // Assert Assert.Equal(0, actualResult); }
public void CompareTest_PassTwoEnergyObservation_Return1OrMinus1Or0 (double xCoordinate1, double yCoordinate1, double xCoordinate2, double yCoordinate2, int expectedResult) { // Arange var sut = new ObservationPointComparer <IEnergyObservation>(); var energyMock1 = GetEnergyObservationMock(xCoordinate1, yCoordinate1); var energyMock2 = GetEnergyObservationMock(xCoordinate2, yCoordinate2); // Act var actualResult = sut.Compare(energyMock1.Object, energyMock2.Object); // Assert Assert.Equal(expectedResult, actualResult); }
public void CompareTest_FirstAndSecondIEnergyObservations_CorrectComparisonIsMade(IEnergyObservation first, IEnergyObservation second, int expected) { int actual = _observationPointComparer.Compare(first, second); Assert.Equal(expected, actual); }