public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse() { // Arrange var mapper = new PersonAliasMapper(); var model = PersonAliasesMockingSetup.DoMockingSetupForPersonAliasModel(1); var entity = PersonAliasesMockingSetup.DoMockingSetupForPersonAlias(2); // Act var result = mapper.AreEqual(model.Object, entity.Object); // Assert Assert.False(result); }
public void Verify_MapToModelLite_AssignsLiteOnlyPersonAliasProperties() { // Arrange var mapper = new PersonAliasMapper(); var entity = PersonAliasesMockingSetup.DoMockingSetupForPersonAlias(); // Act var model = mapper.MapToModelLite(entity.Object); // Assert // <None> // Related Objects Assert.Equal(entity.Object.PersonId, model.PersonId); }
public void Verify_MapToModelListingExtension_CallsMapToModel() { // Arrange var mockMapper = new Mock <PersonAliasMapper>(); mockMapper.Setup(x => x.MapToModelListing(It.IsAny <IPersonAlias>(), It.IsAny <int>())); var mockEntity = PersonAliasesMockingSetup.DoMockingSetupForPersonAlias(1); PersonAliasMapperExtensions.OverrideMapper(mockMapper.Object); // Act mockEntity.Object.MapToModelListing(); // Assert mockMapper.Verify(x => x.MapToModelListing(It.IsAny <IPersonAlias>(), It.IsAny <int>()), Times.Once); }