Esempio n. 1
0
        public void EqualsTest_FirstObservationIsNullSecondObservationIsNotNull_ResultIsFalse()
        {
            // Arange
            var sut        = new ObservationPointEqualityComparer <IEnergyObservation>();
            var energyMock = new Mock <IEnergyObservation>();

            // Act
            var actualResult = sut.Equals(null, energyMock.Object);

            // Assert
            Assert.False(actualResult);
        }
Esempio n. 2
0
        public void EqualsTest_ObservationReferencesAreEqual_ResultIsTrue()
        {
            // Arange
            var sut         = new ObservationPointEqualityComparer <IEnergyObservation>();
            var energyMock1 = new Mock <IEnergyObservation>();
            var energyMock2 = energyMock1;

            // Act
            var actualResult = sut.Equals(energyMock1.Object, energyMock2.Object);

            // Assert
            Assert.True(actualResult);
        }
Esempio n. 3
0
        public void EqualsTest_PassTwoEnergyObservation_ReturnTrueOrFalse
            (double xCoordinate1, double yCoordinate1,
            double xCoordinate2, double yCoordinate2, bool expectedResult)
        {
            // Arange
            var sut         = new ObservationPointEqualityComparer <IEnergyObservation>();
            var energyMock1 = GetEnergyObservationMock(xCoordinate1, yCoordinate1);
            var energyMock2 = GetEnergyObservationMock(xCoordinate2, yCoordinate2);


            // Act
            var actualResult = sut.Equals(energyMock1.Object, energyMock2.Object);

            // Assert
            Assert.Equal(expectedResult, actualResult);
        }