public void Verify_MapToEntityExtension_CallsMapToEntity() { // Arrange var mockMapper = new Mock <LocationMapper>(); mockMapper.Setup(x => x.MapToEntity(It.IsAny <ILocationModel>(), It.IsAny <int>())); var mockModel = LocationsMockingSetup.DoMockingSetupForLocationModel(1); LocationMapperExtensions.OverrideMapper(mockMapper.Object); // Act mockModel.Object.MapToEntity(); // Assert mockMapper.Verify(x => x.MapToEntity(It.IsAny <ILocationModel>(), It.IsAny <int>()), Times.Once); }
public void Verify_AreEqualExtension_CallsAreEqual() { // Arrange var mockMapper = new Mock <LocationMapper>(); mockMapper.Setup(x => x.AreEqual(It.IsAny <ILocationModel>(), It.IsAny <ILocation>())); LocationMapperExtensions.OverrideMapper(mockMapper.Object); var mockModel = LocationsMockingSetup.DoMockingSetupForLocationModel(1); var mockEntity = LocationsMockingSetup.DoMockingSetupForLocation(1); // Act mockModel.Object.AreEqual(mockEntity.Object); // Assert mockMapper.Verify(x => x.AreEqual(It.IsAny <ILocationModel>(), It.IsAny <ILocation>()), Times.Once); }