public void GetWriterSuccessTest() { //Arrange IFileStreamWriter fileStreamWriter = new FileStreamWriter(); string filePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestFiles\\DummyFile.txt"); FileInfo fileInfo = new FileInfo(filePath); //Act using (var streamWriter = fileStreamWriter.GetWriter(fileInfo)) { //Assert Assert.IsTrue(streamWriter is StreamWriter, $"File: {fileInfo.FullName} could not be written to"); } }