Exemple #1
0
        public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse()
        {
            // Arrange
            var mapper = new LocationAliasMapper();
            var model  = LocationAliasesMockingSetup.DoMockingSetupForLocationAliasModel(1);
            var entity = LocationAliasesMockingSetup.DoMockingSetupForLocationAlias(2);
            // Act
            var result = mapper.AreEqual(model.Object, entity.Object);

            // Assert
            Assert.False(result);
        }
Exemple #2
0
        public void Verify_MapToModelLite_AssignsLiteOnlyLocationAliasProperties()
        {
            // Arrange
            var mapper = new LocationAliasMapper();
            var entity = LocationAliasesMockingSetup.DoMockingSetupForLocationAlias();
            // Act
            var model = mapper.MapToModelLite(entity.Object);

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

            mockMapper.Setup(x => x.MapToModelListing(It.IsAny <ILocationAlias>(), It.IsAny <int>()));
            var mockEntity = LocationAliasesMockingSetup.DoMockingSetupForLocationAlias(1);

            LocationAliasMapperExtensions.OverrideMapper(mockMapper.Object);
            // Act
            mockEntity.Object.MapToModelListing();
            // Assert
            mockMapper.Verify(x => x.MapToModelListing(It.IsAny <ILocationAlias>(), It.IsAny <int>()), Times.Once);
        }