In one of my C# projects I wanted to add tests for a class that uses System.Net.Sockets.Socket. The problem was that the class (FTPConnection) depended directly on Socket as shown in the following class diagram. So I had to find a way to get rid of this direct dependency and…