Example #1
0
        public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new VolumeLocationMapper();
            var model  = VolumeLocationsMockingSetup.DoMockingSetupForVolumeLocationModel(1);
            var entity = VolumeLocationsMockingSetup.DoMockingSetupForVolumeLocation(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.False(result);
        }
Example #2
0
        public void Verify_MapToModelLite_AssignsLiteOnlyVolumeLocationProperties()
        {
            // Arrange
            var mapper = new VolumeLocationMapper();
            var entity = VolumeLocationsMockingSetup.DoMockingSetupForVolumeLocation();
            // Act
            var model = mapper.MapToModelLite(entity.Object);

            // Assert
            // <None>
            // Related Objects
            Assert.Equal(entity.Object.VolumeId, model.VolumeId);
            Assert.Equal(entity.Object.LocationId, model.LocationId);
        }
Example #3
0
        public void Verify_MapToModelListingExtension_CallsMapToModel()
        {
            // Arrange
            var mockMapper = new Mock <VolumeLocationMapper>();

            mockMapper.Setup(x => x.MapToModelListing(It.IsAny <IVolumeLocation>(), It.IsAny <int>()));
            var mockEntity = VolumeLocationsMockingSetup.DoMockingSetupForVolumeLocation(1);

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

            mockMapper.Setup(x => x.AreEqual(It.IsAny <IVolumeLocationModel>(), It.IsAny <IVolumeLocation>()));
            VolumeLocationMapperExtensions.OverrideMapper(mockMapper.Object);
            var mockModel  = VolumeLocationsMockingSetup.DoMockingSetupForVolumeLocationModel(1);
            var mockEntity = VolumeLocationsMockingSetup.DoMockingSetupForVolumeLocation(1);

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