Beispiel #1
0
        public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new ConceptIssueMapper();
            var model  = ConceptIssuesMockingSetup.DoMockingSetupForConceptIssueModel(1);
            var entity = ConceptIssuesMockingSetup.DoMockingSetupForConceptIssue(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.False(result);
        }
Beispiel #2
0
        public void Verify_MapToModelLite_AssignsLiteOnlyConceptIssueProperties()
        {
            // Arrange
            var mapper = new ConceptIssueMapper();
            var entity = ConceptIssuesMockingSetup.DoMockingSetupForConceptIssue();
            // Act
            var model = mapper.MapToModelLite(entity.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(entity.Object.ConceptId, model.ConceptId);
            Assert.Equal(entity.Object.IssueId, model.IssueId);
        }
Beispiel #3
0
        public void Verify_MapToModelListingExtension_CallsMapToModel()
        {
            // Arrange
            var mockMapper = new Mock <ConceptIssueMapper>();

            mockMapper.Setup(x => x.MapToModelListing(It.IsAny <IConceptIssue>(), It.IsAny <int>()));
            var mockEntity = ConceptIssuesMockingSetup.DoMockingSetupForConceptIssue(1);

            ConceptIssueMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockEntity.Object.MapToModelListing();
            // Assert
            mockMapper.Verify(x => x.MapToModelListing(It.IsAny <IConceptIssue>(), It.IsAny <int>()), Times.Once);
        }
Beispiel #4
0
        public void Verify_AreEqualExtension_CallsAreEqual()
        {
            // Arrange
            var mockMapper = new Mock <ConceptIssueMapper>();

            mockMapper.Setup(x => x.AreEqual(It.IsAny <IConceptIssueModel>(), It.IsAny <IConceptIssue>()));
            ConceptIssueMapperExtensions.OverrideMapper(mockMapper.Object);
            var mockModel  = ConceptIssuesMockingSetup.DoMockingSetupForConceptIssueModel(1);
            var mockEntity = ConceptIssuesMockingSetup.DoMockingSetupForConceptIssue(1);

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