public void ReturnTheCorrectValue_WhenGenderIsSetToFemale()
        {
            // Arrange
            var expectedResult = 1457.75;
            var goalMock       = new Mock <IGoal>();

            goalMock
            .SetupGet(m => m.Gender)
            .Returns(GenderType.female);

            goalMock
            .SetupGet(m => m.StartingWeight)
            .Returns(65);

            goalMock
            .SetupGet(m => m.Height)
            .Returns(175);

            goalMock
            .SetupGet(m => m.Age)
            .Returns(25);

            var restingEnergy = new RestingEnergyCalculator();

            // Act
            var actualResult = restingEnergy.CalculateRestingEnergy(goalMock.Object);

            // Assert
            Assert.AreEqual(expectedResult, actualResult);
        }
Ejemplo n.º 2
0
        public void ReturnInstance_WhenInvokedWithValidGoalParameter()
        {
            // Arrange
            var goalMock = new Mock <IGoal>();

            // Act
            var restingEnergy = new RestingEnergyCalculator();

            // Assert
            Assert.IsNotNull(restingEnergy);
            Assert.IsInstanceOfType(restingEnergy, typeof(IRestingEnergyCalculator));
        }