Ejemplo n.º 1
0
        public void Verify_MapToEntityExtension_CallsMapToEntity()
        {
            // Arrange
            var mockMapper = new Mock <SeriesMapper>();

            mockMapper.Setup(x => x.MapToEntity(It.IsAny <ISeriesModel>(), It.IsAny <int>()));
            var mockModel = SeriesMockingSetup.DoMockingSetupForSeriesModel(1);

            SeriesMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockModel.Object.MapToEntity();
            // Assert
            mockMapper.Verify(x => x.MapToEntity(It.IsAny <ISeriesModel>(), It.IsAny <int>()), Times.Once);
        }
Ejemplo n.º 2
0
        public void Verify_AreEqualExtension_CallsAreEqual()
        {
            // Arrange
            var mockMapper = new Mock <SeriesMapper>();

            mockMapper.Setup(x => x.AreEqual(It.IsAny <ISeriesModel>(), It.IsAny <ISeries>()));
            SeriesMapperExtensions.OverrideMapper(mockMapper.Object);
            var mockModel  = SeriesMockingSetup.DoMockingSetupForSeriesModel(1);
            var mockEntity = SeriesMockingSetup.DoMockingSetupForSeries(1);

            // Act
            mockModel.Object.AreEqual(mockEntity.Object);
            // Assert
            mockMapper.Verify(x => x.AreEqual(It.IsAny <ISeriesModel>(), It.IsAny <ISeries>()), Times.Once);
        }