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

            mockMapper.Setup(x => x.MapToEntity(It.IsAny <IIssueModel>(), It.IsAny <int>()));
            var mockModel = IssuesMockingSetup.DoMockingSetupForIssueModel(1);

            IssueMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockModel.Object.MapToEntity();
            // Assert
            mockMapper.Verify(x => x.MapToEntity(It.IsAny <IIssueModel>(), It.IsAny <int>()), Times.Once);
        }
Esempio n. 2
0
        public void Verify_AreEqualExtension_CallsAreEqual()
        {
            // Arrange
            var mockMapper = new Mock <IssueMapper>();

            mockMapper.Setup(x => x.AreEqual(It.IsAny <IIssueModel>(), It.IsAny <IIssue>()));
            IssueMapperExtensions.OverrideMapper(mockMapper.Object);
            var mockModel  = IssuesMockingSetup.DoMockingSetupForIssueModel(1);
            var mockEntity = IssuesMockingSetup.DoMockingSetupForIssue(1);

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