public void GetFiles_DirectoryGetFiles_called() { var testObject = new FileSystem(); var someRandomPath = @"d:\temp\test"; var someRandomPattern = "*.txt"; var isMethodCalled = false; using(ShimsContext.Create()) { System.IO.Fakes.ShimDirectory.GetFilesStringString = (path, pattern) => { isMethodCalled = true; return null; }; testObject.GetFiles(someRandomPath, someRandomPattern); } Assert.IsTrue(isMethodCalled); }