public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new ObjectIssueMapper();
            var model  = ObjectIssuesMockingSetup.DoMockingSetupForObjectIssueModel(1);
            var entity = ObjectIssuesMockingSetup.DoMockingSetupForObjectIssue(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.False(result);
        }
        public void Verify_MapToEntityExtension_CallsMapToEntity()
        {
            // Arrange
            var mockMapper = new Mock <ObjectIssueMapper>();

            mockMapper.Setup(x => x.MapToEntity(It.IsAny <IObjectIssueModel>(), It.IsAny <int>()));
            var mockModel = ObjectIssuesMockingSetup.DoMockingSetupForObjectIssueModel(1);

            ObjectIssueMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockModel.Object.MapToEntity();
            // Assert
            mockMapper.Verify(x => x.MapToEntity(It.IsAny <IObjectIssueModel>(), It.IsAny <int>()), Times.Once);
        }
        public void Verify_MapToModelLite_AssignsLiteOnlyObjectIssueProperties()
        {
            // Arrange
            var mapper = new ObjectIssueMapper();
            var entity = ObjectIssuesMockingSetup.DoMockingSetupForObjectIssue();
            // Act
            var model = mapper.MapToModelLite(entity.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(entity.Object.ObjectId, model.ObjectId);
            Assert.Equal(entity.Object.IssueId, model.IssueId);
        }
        public void Verify_AreEqualExtension_CallsAreEqual()
        {
            // Arrange
            var mockMapper = new Mock <ObjectIssueMapper>();

            mockMapper.Setup(x => x.AreEqual(It.IsAny <IObjectIssueModel>(), It.IsAny <IObjectIssue>()));
            ObjectIssueMapperExtensions.OverrideMapper(mockMapper.Object);
            var mockModel  = ObjectIssuesMockingSetup.DoMockingSetupForObjectIssueModel(1);
            var mockEntity = ObjectIssuesMockingSetup.DoMockingSetupForObjectIssue(1);

            // Act
            mockModel.Object.AreEqual(mockEntity.Object);
            // Assert
            mockMapper.Verify(x => x.AreEqual(It.IsAny <IObjectIssueModel>(), It.IsAny <IObjectIssue>()), Times.Once);
        }
        public void Verify_MapToEntity_AssignsObjectIssueProperties()
        {
            // Arrange
            var mapper = new ObjectIssueMapper();
            var model  = ObjectIssuesMockingSetup.DoMockingSetupForObjectIssueModel();
            // Act
            var entity = mapper.MapToEntity(model.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(model.Object.ObjectId, entity.ObjectId);
            Assert.Equal(model.Object.IssueId, entity.IssueId);
            // Associated Objects
            // <None>
        }
        public void Verify_MapToSearchModel_AssignsObjectIssueSearchProperties()
        {
            // Arrange
            var mapper = new ObjectIssueMapper();
            var model  = ObjectIssuesMockingSetup.DoMockingSetupForObjectIssueModel();
            // Act
            var searchModel = mapper.MapToSearchModel(model.Object);

            // Assert
            Assert.Equal(model.Object.ObjectId, searchModel.ObjectId);
            Assert.Equal(model.Object.Object?.CustomKey, searchModel.ObjectCustomKey);
            Assert.Equal(model.Object.Object?.ApiDetailUrl, searchModel.ObjectApiDetailUrl);
            Assert.Equal(model.Object.Object?.SiteDetailUrl, searchModel.ObjectSiteDetailUrl);
            Assert.Equal(model.Object.Object?.Name, searchModel.ObjectName);
            Assert.Equal(model.Object.Object?.ShortDescription, searchModel.ObjectShortDescription);
            Assert.Equal(model.Object.Object?.Description, searchModel.ObjectDescription);
            Assert.Equal(model.Object.IssueId, searchModel.IssueId);
            Assert.Equal(model.Object.Issue?.CustomKey, searchModel.IssueCustomKey);
            Assert.Equal(model.Object.Issue?.ApiDetailUrl, searchModel.IssueApiDetailUrl);
            Assert.Equal(model.Object.Issue?.SiteDetailUrl, searchModel.IssueSiteDetailUrl);
            Assert.Equal(model.Object.Issue?.Name, searchModel.IssueName);
            Assert.Equal(model.Object.Issue?.ShortDescription, searchModel.IssueShortDescription);
            Assert.Equal(model.Object.Issue?.Description, searchModel.IssueDescription);
        }