public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse() { // Arrange var mapper = new ProfileMapper(); var model = ProfilesMockingSetup.DoMockingSetupForProfileModel(1); var entity = ProfilesMockingSetup.DoMockingSetupForProfile(2); // Act var result = mapper.AreEqual(model.Object, entity.Object); // Assert Assert.False(result); }
public void Verify_MapToModelLite_AssignsLiteOnlyProfileProperties() { // Arrange var mapper = new ProfileMapper(); var entity = ProfilesMockingSetup.DoMockingSetupForProfile(); // Act var model = mapper.MapToModelLite(entity.Object); // Assert // <None> // Related Objects // <None> }
public void Verify_MapToModelListingExtension_CallsMapToModel() { // Arrange var mockMapper = new Mock <ProfileMapper>(); mockMapper.Setup(x => x.MapToModelListing(It.IsAny <IProfile>(), It.IsAny <int>())); var mockEntity = ProfilesMockingSetup.DoMockingSetupForProfile(1); ProfileMapperExtensions.OverrideMapper(mockMapper.Object); // Act mockEntity.Object.MapToModelListing(); // Assert mockMapper.Verify(x => x.MapToModelListing(It.IsAny <IProfile>(), It.IsAny <int>()), Times.Once); }
public void Verify_MapToModel_AssignsProfileProperties() { // Arrange var mapper = new ProfileMapper(); var entity = ProfilesMockingSetup.DoMockingSetupForProfile(); // Act var model = mapper.MapToModel(entity.Object); // Assert // <None> // Related Objects // <None> // Associated Objects Assert.Equal(entity.Object.OriginProfiles?.Count, model.OriginProfiles?.Count); }
public void Verify_AreEqualExtension_CallsAreEqual() { // Arrange var mockMapper = new Mock <ProfileMapper>(); mockMapper.Setup(x => x.AreEqual(It.IsAny <IProfileModel>(), It.IsAny <IProfile>())); ProfileMapperExtensions.OverrideMapper(mockMapper.Object); var mockModel = ProfilesMockingSetup.DoMockingSetupForProfileModel(1); var mockEntity = ProfilesMockingSetup.DoMockingSetupForProfile(1); // Act mockModel.Object.AreEqual(mockEntity.Object); // Assert mockMapper.Verify(x => x.AreEqual(It.IsAny <IProfileModel>(), It.IsAny <IProfile>()), Times.Once); }