public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse() { // Arrange var mapper = new ObjectVolumeMapper(); var model = ObjectVolumesMockingSetup.DoMockingSetupForObjectVolumeModel(1); var entity = ObjectVolumesMockingSetup.DoMockingSetupForObjectVolume(2); // Act var result = mapper.AreEqual(model.Object, entity.Object); // Assert Assert.False(result); }
public void Verify_MapToModelLite_AssignsLiteOnlyObjectVolumeProperties() { // Arrange var mapper = new ObjectVolumeMapper(); var entity = ObjectVolumesMockingSetup.DoMockingSetupForObjectVolume(); // Act var model = mapper.MapToModelLite(entity.Object); // Assert // <None> // Related Objects Assert.Equal(entity.Object.ObjectId, model.ObjectId); Assert.Equal(entity.Object.VolumeId, model.VolumeId); }
public void Verify_MapToModelListingExtension_CallsMapToModel() { // Arrange var mockMapper = new Mock <ObjectVolumeMapper>(); mockMapper.Setup(x => x.MapToModelListing(It.IsAny <IObjectVolume>(), It.IsAny <int>())); var mockEntity = ObjectVolumesMockingSetup.DoMockingSetupForObjectVolume(1); ObjectVolumeMapperExtensions.OverrideMapper(mockMapper.Object); // Act mockEntity.Object.MapToModelListing(); // Assert mockMapper.Verify(x => x.MapToModelListing(It.IsAny <IObjectVolume>(), It.IsAny <int>()), Times.Once); }
public void Verify_AreEqualExtension_CallsAreEqual() { // Arrange var mockMapper = new Mock <ObjectVolumeMapper>(); mockMapper.Setup(x => x.AreEqual(It.IsAny <IObjectVolumeModel>(), It.IsAny <IObjectVolume>())); ObjectVolumeMapperExtensions.OverrideMapper(mockMapper.Object); var mockModel = ObjectVolumesMockingSetup.DoMockingSetupForObjectVolumeModel(1); var mockEntity = ObjectVolumesMockingSetup.DoMockingSetupForObjectVolume(1); // Act mockModel.Object.AreEqual(mockEntity.Object); // Assert mockMapper.Verify(x => x.AreEqual(It.IsAny <IObjectVolumeModel>(), It.IsAny <IObjectVolume>()), Times.Once); }