public void Verify_Add_Should_AddTheEntityToTheContext() { // Arrange Mock<IDbSet<MovieStoryArc>> mockSetMovieStoryArcs; var mockContext = MovieStoryArcsMockingSetup.DoMockingSetupForContext(false, out mockSetMovieStoryArcs); var repository = new MovieStoryArcsRepository(mockContext.Object); var movieStoryArcs = new MovieStoryArc { Active = true, CustomKey = "SALVATORE-RAA", }; // Act repository.Add(movieStoryArcs); // Assert mockSetMovieStoryArcs.Verify(x => x.Add(movieStoryArcs), Times.Once); }
public void Verify_Add_Should_AddTheEntityToTheContext() { // Arrange Mock <IDbSet <MovieStoryArc> > mockSetMovieStoryArcs; var mockContext = MovieStoryArcsMockingSetup.DoMockingSetupForContext(false, out mockSetMovieStoryArcs); var repository = new MovieStoryArcsRepository(mockContext.Object); var movieStoryArcs = new MovieStoryArc { Active = true, CustomKey = "SALVATORE-RAA", }; // Act repository.Add(movieStoryArcs); // Assert mockSetMovieStoryArcs.Verify(x => x.Add(movieStoryArcs), Times.Once); }
public void Verify_MapToEntity_WithExistingEntity_AssignsMovieStoryArcProperties() { // Arrange var mapper = new MovieStoryArcMapper(); var model = MovieStoryArcsMockingSetup.DoMockingSetupForMovieStoryArcModel(); // Act IMovieStoryArc existingEntity = new MovieStoryArc { Id = 1 }; mapper.MapToEntity(model.Object, ref existingEntity); // Assert // <None> // Related Objects Assert.Equal(model.Object.MovieId, existingEntity.MovieId); Assert.Equal(model.Object.StoryArcId, existingEntity.StoryArcId); // Associated Objects // <None> }
public void Verify_MapToEntity_WithExistingEntity_AssignsMovieStoryArcProperties() { // Arrange var mapper = new MovieStoryArcMapper(); var model = MovieStoryArcsMockingSetup.DoMockingSetupForMovieStoryArcModel(); // Act IMovieStoryArc existingEntity = new MovieStoryArc { Id = 1 }; mapper.MapToEntity(model.Object, ref existingEntity); // Assert // <None> // Related Objects Assert.Equal(model.Object.MovieId, existingEntity.MovieId); Assert.Equal(model.Object.StoryArcId, existingEntity.StoryArcId); // Associated Objects // <None> }