public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new VideoMapper();
            var model  = VideosMockingSetup.DoMockingSetupForVideoModel(1);
            var entity = VideosMockingSetup.DoMockingSetupForVideo(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

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

            mockMapper.Setup(x => x.MapToModelListing(It.IsAny <IVideo>(), It.IsAny <int>()));
            var mockEntity = VideosMockingSetup.DoMockingSetupForVideo(1);

            VideoMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockEntity.Object.MapToModelListing();
            // Assert
            mockMapper.Verify(x => x.MapToModelListing(It.IsAny <IVideo>(), It.IsAny <int>()), Times.Once);
        }
        public void Verify_AreEqualExtension_CallsAreEqual()
        {
            // Arrange
            var mockMapper = new Mock <VideoMapper>();

            mockMapper.Setup(x => x.AreEqual(It.IsAny <IVideoModel>(), It.IsAny <IVideo>()));
            VideoMapperExtensions.OverrideMapper(mockMapper.Object);
            var mockModel  = VideosMockingSetup.DoMockingSetupForVideoModel(1);
            var mockEntity = VideosMockingSetup.DoMockingSetupForVideo(1);

            // Act
            mockModel.Object.AreEqual(mockEntity.Object);
            // Assert
            mockMapper.Verify(x => x.AreEqual(It.IsAny <IVideoModel>(), It.IsAny <IVideo>()), Times.Once);
        }
        public void Verify_MapToModelLite_AssignsLiteOnlyVideoProperties()
        {
            // Arrange
            var mapper = new VideoMapper();
            var entity = VideosMockingSetup.DoMockingSetupForVideo();
            // Act
            var model = mapper.MapToModelLite(entity.Object);

            // Assert
            Assert.Equal(entity.Object.LowUrl, model.LowUrl);
            Assert.Equal(entity.Object.HighUrl, model.HighUrl);
            Assert.Equal(entity.Object.HdUrl, model.HdUrl);
            Assert.Equal(entity.Object.Url, model.Url);
            Assert.Equal(entity.Object.LengthSeconds, model.LengthSeconds);
            Assert.Equal(entity.Object.PublishDate, model.PublishDate);
            // Related Objects
            Assert.Equal(entity.Object.PrimaryImageFileId, model.PrimaryImageFileId);
            Assert.Equal(entity.Object.AuthorId, model.AuthorId);
            Assert.Equal(entity.Object.VideoTypeId, model.VideoTypeId);
        }