public void Repository_Remove() { var Id = 1; var post = new Post { Id = Id }; _postRepository.Remove(p => p.Id == Id); _codingSoldierDbContext.ReceivedWithAnyArgs().Entry <Post>(post); _codingSoldierDbContext.Received().SaveChanges(); }