I have read on numerous occasions that tests should not be coupled to implementation details - this makes perfect sense.Now I am having some trouble decoupling my tests from implementation details and am kindly asking for some help.The relevant portion of the repository that I am testing looks like this:public class PostsRepository : IPostsRepository{    private readonly DatabaseContext context;    public PostsRepository(DatabaseContext context)    {        this.context = context;    }    public Post Find(string slug)    {        return context            .Posts            .SingleOrDefault(post => post.Slug == slug);    }    public bool Delete(string slug)    {        var post = Find(slug);        if (post == null) return false;        context.Posts.Remove(post);        return true;    }}The context is mocked using the technique described here and then manually injected into the repository.The corresponding tests that I am concerned about look like this:[Test]public void Delete_ExistentPost_DeletesPost(){    databaseSet.SetupSeedData(new List<Post>    {        PostsMother.CreatePost(withSlug: abc)    });    repository.Delete(abc);    databaseSet.Verify(d => d.Remove(It.IsAny<Post>()));}[Test]public void Delete_NonExistentPost_DoesNotThrow(){    repository.Delete(abc);}[Test]public void Delete_ExistentPost_ReturnsTrue(){    databaseSet.SetupSeedData(new List<Post>    {        PostsMother.CreatePost(withSlug: abc)    });    var actual = repository.Delete(abc);    Assert.True(actual);}[Test]public void Delete_NonExistentPost_ReturnsFalse(){    var actual = repository.Delete(abc);    Assert.False(actual);}These tests seem to work well enough but I am concerned about their brittleness. If you look at the implementation of the Delete method you will see that it uses the Remove method but what if that changed? The test would break.Furthermore (and more importantly), the test is highly dependent on the Delete method using the Find method as the Find method uses the Posts property of the database set which is stubbed according to the seed data configured in the arrange phase of the test (using SetUpSeedData).It is perfectly conceivable that I will adjust the implementation of the Delete method to catch an exception and return the boolean according to the exception instead of using the Find method.How can I improve the resilience of my tests in this case?
Decoupling tests from implementation and increase their resilience
c#;unit testing