public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse() { // Arrange var mapper = new MovieWriterMapper(); var model = MovieWritersMockingSetup.DoMockingSetupForMovieWriterModel(1); var entity = MovieWritersMockingSetup.DoMockingSetupForMovieWriter(2); // Act var result = mapper.AreEqual(model.Object, entity.Object); // Assert Assert.False(result); }
public void Verify_MapToModelLite_AssignsLiteOnlyMovieWriterProperties() { // Arrange var mapper = new MovieWriterMapper(); var entity = MovieWritersMockingSetup.DoMockingSetupForMovieWriter(); // Act var model = mapper.MapToModelLite(entity.Object); // Assert // <None> // Related Objects Assert.Equal(entity.Object.MovieId, model.MovieId); Assert.Equal(entity.Object.WriterId, model.WriterId); }
public void Verify_MapToModelListingExtension_CallsMapToModel() { // Arrange var mockMapper = new Mock <MovieWriterMapper>(); mockMapper.Setup(x => x.MapToModelListing(It.IsAny <IMovieWriter>(), It.IsAny <int>())); var mockEntity = MovieWritersMockingSetup.DoMockingSetupForMovieWriter(1); MovieWriterMapperExtensions.OverrideMapper(mockMapper.Object); // Act mockEntity.Object.MapToModelListing(); // Assert mockMapper.Verify(x => x.MapToModelListing(It.IsAny <IMovieWriter>(), It.IsAny <int>()), Times.Once); }
public void Verify_AreEqualExtension_CallsAreEqual() { // Arrange var mockMapper = new Mock <MovieWriterMapper>(); mockMapper.Setup(x => x.AreEqual(It.IsAny <IMovieWriterModel>(), It.IsAny <IMovieWriter>())); MovieWriterMapperExtensions.OverrideMapper(mockMapper.Object); var mockModel = MovieWritersMockingSetup.DoMockingSetupForMovieWriterModel(1); var mockEntity = MovieWritersMockingSetup.DoMockingSetupForMovieWriter(1); // Act mockModel.Object.AreEqual(mockEntity.Object); // Assert mockMapper.Verify(x => x.AreEqual(It.IsAny <IMovieWriterModel>(), It.IsAny <IMovieWriter>()), Times.Once); }