public void Verify_Add_Should_AddTheEntityToTheContext() { // Arrange Mock<IDbSet<LocationStoryArc>> mockSetLocationStoryArcs; var mockContext = LocationStoryArcsMockingSetup.DoMockingSetupForContext(false, out mockSetLocationStoryArcs); var repository = new LocationStoryArcsRepository(mockContext.Object); var locationStoryArcs = new LocationStoryArc { Active = true, CustomKey = "SALVATORE-RAA", }; // Act repository.Add(locationStoryArcs); // Assert mockSetLocationStoryArcs.Verify(x => x.Add(locationStoryArcs), Times.Once); }
public void Verify_Add_Should_AddTheEntityToTheContext() { // Arrange Mock <IDbSet <LocationStoryArc> > mockSetLocationStoryArcs; var mockContext = LocationStoryArcsMockingSetup.DoMockingSetupForContext(false, out mockSetLocationStoryArcs); var repository = new LocationStoryArcsRepository(mockContext.Object); var locationStoryArcs = new LocationStoryArc { Active = true, CustomKey = "SALVATORE-RAA", }; // Act repository.Add(locationStoryArcs); // Assert mockSetLocationStoryArcs.Verify(x => x.Add(locationStoryArcs), Times.Once); }
public void Verify_MapToEntity_WithExistingEntity_AssignsLocationStoryArcProperties() { // Arrange var mapper = new LocationStoryArcMapper(); var model = LocationStoryArcsMockingSetup.DoMockingSetupForLocationStoryArcModel(); // Act ILocationStoryArc existingEntity = new LocationStoryArc { Id = 1 }; mapper.MapToEntity(model.Object, ref existingEntity); // Assert // <None> // Related Objects Assert.Equal(model.Object.LocationId, existingEntity.LocationId); Assert.Equal(model.Object.StoryArcId, existingEntity.StoryArcId); // Associated Objects // <None> }