public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse() { // Arrange var mapper = new EpisodeConceptMapper(); var model = EpisodeConceptsMockingSetup.DoMockingSetupForEpisodeConceptModel(1); var entity = EpisodeConceptsMockingSetup.DoMockingSetupForEpisodeConcept(2); // Act var result = mapper.AreEqual(model.Object, entity.Object); // Assert Assert.False(result); }
public void Verify_MapToModelLite_AssignsLiteOnlyEpisodeConceptProperties() { // Arrange var mapper = new EpisodeConceptMapper(); var entity = EpisodeConceptsMockingSetup.DoMockingSetupForEpisodeConcept(); // Act var model = mapper.MapToModelLite(entity.Object); // Assert // <None> // Related Objects Assert.Equal(entity.Object.EpisodeId, model.EpisodeId); Assert.Equal(entity.Object.ConceptId, model.ConceptId); }
public void Verify_MapToModelListingExtension_CallsMapToModel() { // Arrange var mockMapper = new Mock <EpisodeConceptMapper>(); mockMapper.Setup(x => x.MapToModelListing(It.IsAny <IEpisodeConcept>(), It.IsAny <int>())); var mockEntity = EpisodeConceptsMockingSetup.DoMockingSetupForEpisodeConcept(1); EpisodeConceptMapperExtensions.OverrideMapper(mockMapper.Object); // Act mockEntity.Object.MapToModelListing(); // Assert mockMapper.Verify(x => x.MapToModelListing(It.IsAny <IEpisodeConcept>(), It.IsAny <int>()), Times.Once); }
public void Verify_AreEqualExtension_CallsAreEqual() { // Arrange var mockMapper = new Mock <EpisodeConceptMapper>(); mockMapper.Setup(x => x.AreEqual(It.IsAny <IEpisodeConceptModel>(), It.IsAny <IEpisodeConcept>())); EpisodeConceptMapperExtensions.OverrideMapper(mockMapper.Object); var mockModel = EpisodeConceptsMockingSetup.DoMockingSetupForEpisodeConceptModel(1); var mockEntity = EpisodeConceptsMockingSetup.DoMockingSetupForEpisodeConcept(1); // Act mockModel.Object.AreEqual(mockEntity.Object); // Assert mockMapper.Verify(x => x.AreEqual(It.IsAny <IEpisodeConceptModel>(), It.IsAny <IEpisodeConcept>()), Times.Once); }