public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse() { // Arrange var mapper = new CharacterPowerMapper(); var model = CharacterPowersMockingSetup.DoMockingSetupForCharacterPowerModel(1); var entity = CharacterPowersMockingSetup.DoMockingSetupForCharacterPower(2); // Act var result = mapper.AreEqual(model.Object, entity.Object); // Assert Assert.False(result); }
public void Verify_MapToModelLite_AssignsLiteOnlyCharacterPowerProperties() { // Arrange var mapper = new CharacterPowerMapper(); var entity = CharacterPowersMockingSetup.DoMockingSetupForCharacterPower(); // Act var model = mapper.MapToModelLite(entity.Object); // Assert // <None> // Related Objects Assert.Equal(entity.Object.CharacterId, model.CharacterId); Assert.Equal(entity.Object.PowerId, model.PowerId); }
public void Verify_MapToModelListingExtension_CallsMapToModel() { // Arrange var mockMapper = new Mock <CharacterPowerMapper>(); mockMapper.Setup(x => x.MapToModelListing(It.IsAny <ICharacterPower>(), It.IsAny <int>())); var mockEntity = CharacterPowersMockingSetup.DoMockingSetupForCharacterPower(1); CharacterPowerMapperExtensions.OverrideMapper(mockMapper.Object); // Act mockEntity.Object.MapToModelListing(); // Assert mockMapper.Verify(x => x.MapToModelListing(It.IsAny <ICharacterPower>(), It.IsAny <int>()), Times.Once); }
public void Verify_AreEqualExtension_CallsAreEqual() { // Arrange var mockMapper = new Mock <CharacterPowerMapper>(); mockMapper.Setup(x => x.AreEqual(It.IsAny <ICharacterPowerModel>(), It.IsAny <ICharacterPower>())); CharacterPowerMapperExtensions.OverrideMapper(mockMapper.Object); var mockModel = CharacterPowersMockingSetup.DoMockingSetupForCharacterPowerModel(1); var mockEntity = CharacterPowersMockingSetup.DoMockingSetupForCharacterPower(1); // Act mockModel.Object.AreEqual(mockEntity.Object); // Assert mockMapper.Verify(x => x.AreEqual(It.IsAny <ICharacterPowerModel>(), It.IsAny <ICharacterPower>()), Times.Once); }