public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse() { // Arrange var mapper = new TeamStoryArcMapper(); var model = TeamStoryArcsMockingSetup.DoMockingSetupForTeamStoryArcModel(1); var entity = TeamStoryArcsMockingSetup.DoMockingSetupForTeamStoryArc(2); // Act var result = mapper.AreEqual(model.Object, entity.Object); // Assert Assert.False(result); }
public void Verify_MapToModelLite_AssignsLiteOnlyTeamStoryArcProperties() { // Arrange var mapper = new TeamStoryArcMapper(); var entity = TeamStoryArcsMockingSetup.DoMockingSetupForTeamStoryArc(); // Act var model = mapper.MapToModelLite(entity.Object); // Assert // <None> // Related Objects Assert.Equal(entity.Object.TeamId, model.TeamId); Assert.Equal(entity.Object.StoryArcId, model.StoryArcId); }
public void Verify_MapToModelListingExtension_CallsMapToModel() { // Arrange var mockMapper = new Mock <TeamStoryArcMapper>(); mockMapper.Setup(x => x.MapToModelListing(It.IsAny <ITeamStoryArc>(), It.IsAny <int>())); var mockEntity = TeamStoryArcsMockingSetup.DoMockingSetupForTeamStoryArc(1); TeamStoryArcMapperExtensions.OverrideMapper(mockMapper.Object); // Act mockEntity.Object.MapToModelListing(); // Assert mockMapper.Verify(x => x.MapToModelListing(It.IsAny <ITeamStoryArc>(), It.IsAny <int>()), Times.Once); }
public void Verify_AreEqualExtension_CallsAreEqual() { // Arrange var mockMapper = new Mock <TeamStoryArcMapper>(); mockMapper.Setup(x => x.AreEqual(It.IsAny <ITeamStoryArcModel>(), It.IsAny <ITeamStoryArc>())); TeamStoryArcMapperExtensions.OverrideMapper(mockMapper.Object); var mockModel = TeamStoryArcsMockingSetup.DoMockingSetupForTeamStoryArcModel(1); var mockEntity = TeamStoryArcsMockingSetup.DoMockingSetupForTeamStoryArc(1); // Act mockModel.Object.AreEqual(mockEntity.Object); // Assert mockMapper.Verify(x => x.AreEqual(It.IsAny <ITeamStoryArcModel>(), It.IsAny <ITeamStoryArc>()), Times.Once); }