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

            mockMapper.Setup(x => x.MapToEntity(It.IsAny <IStudioModel>(), It.IsAny <int>()));
            var mockModel = StudiosMockingSetup.DoMockingSetupForStudioModel(1);

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

            mockMapper.Setup(x => x.AreEqual(It.IsAny <IStudioModel>(), It.IsAny <IStudio>()));
            StudioMapperExtensions.OverrideMapper(mockMapper.Object);
            var mockModel  = StudiosMockingSetup.DoMockingSetupForStudioModel(1);
            var mockEntity = StudiosMockingSetup.DoMockingSetupForStudio(1);

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