public void Verify_AreEqual_WithDifferentObjects_ReturnsFalse() { // Arrange var mapper = new ObjectStoryArcMapper(); var model = ObjectStoryArcsMockingSetup.DoMockingSetupForObjectStoryArcModel(1); var entity = ObjectStoryArcsMockingSetup.DoMockingSetupForObjectStoryArc(2); // Act var result = mapper.AreEqual(model.Object, entity.Object); // Assert Assert.False(result); }
public void Verify_MapToModelLite_AssignsLiteOnlyObjectStoryArcProperties() { // Arrange var mapper = new ObjectStoryArcMapper(); var entity = ObjectStoryArcsMockingSetup.DoMockingSetupForObjectStoryArc(); // Act var model = mapper.MapToModelLite(entity.Object); // Assert // <None> // Related Objects Assert.Equal(entity.Object.ObjectId, model.ObjectId); Assert.Equal(entity.Object.StoryArcId, model.StoryArcId); }
public void Verify_MapToModelListingExtension_CallsMapToModel() { // Arrange var mockMapper = new Mock <ObjectStoryArcMapper>(); mockMapper.Setup(x => x.MapToModelListing(It.IsAny <IObjectStoryArc>(), It.IsAny <int>())); var mockEntity = ObjectStoryArcsMockingSetup.DoMockingSetupForObjectStoryArc(1); ObjectStoryArcMapperExtensions.OverrideMapper(mockMapper.Object); // Act mockEntity.Object.MapToModelListing(); // Assert mockMapper.Verify(x => x.MapToModelListing(It.IsAny <IObjectStoryArc>(), It.IsAny <int>()), Times.Once); }
public void Verify_AreEqualExtension_CallsAreEqual() { // Arrange var mockMapper = new Mock <ObjectStoryArcMapper>(); mockMapper.Setup(x => x.AreEqual(It.IsAny <IObjectStoryArcModel>(), It.IsAny <IObjectStoryArc>())); ObjectStoryArcMapperExtensions.OverrideMapper(mockMapper.Object); var mockModel = ObjectStoryArcsMockingSetup.DoMockingSetupForObjectStoryArcModel(1); var mockEntity = ObjectStoryArcsMockingSetup.DoMockingSetupForObjectStoryArc(1); // Act mockModel.Object.AreEqual(mockEntity.Object); // Assert mockMapper.Verify(x => x.AreEqual(It.IsAny <IObjectStoryArcModel>(), It.IsAny <IObjectStoryArc>()), Times.Once); }