public void CopyFile_CopyFile_FileExists() { var targetPath = Path.Combine(_xcodeProjectPath, "SomeDirectory", "Test.m"); BuildPostProcess.CopyFile(_testFilePath, targetPath, new TestLogger()); Assert.IsTrue(File.Exists(targetPath)); }
public void CopyFrameworkToXcodeProject_CopyFramework_DirectoryExists() { var targetPath = Path.Combine(_xcodeProjectPath, "SomeDirectory", "Test.framework"); BuildPostProcess.CopyFramework(_testFrameworkPath, targetPath, new TestLogger()); Assert.IsTrue(Directory.Exists(targetPath)); }
public void CopyFile_FileAlreadyExists_LogsSkipMessage() { var testLogger = new TestLogger(); var targetPath = Path.Combine(_xcodeProjectPath, "SomeDirectory", "Test.m"); BuildPostProcess.CopyFile(_testFilePath, targetPath, testLogger); BuildPostProcess.CopyFile(_testFilePath, targetPath, testLogger); Assert.IsTrue(testLogger.Logs.Any(log => log.logLevel == SentryLevel.Debug && log.message.Contains("has already been copied to"))); }
public void CopyFile_FailedToCopyFile_ThrowsFileNotFoundException() => Assert.Throws <FileNotFoundException>(() => BuildPostProcess.CopyFile("non-existent-path.m", Path.Combine(_xcodeProjectPath, "NewDirectory", "Test.m"), new TestLogger()));
public void CopyFramework_FailedToCopy_ThrowsDirectoryNotFoundException() => Assert.Throws <DirectoryNotFoundException>(() => BuildPostProcess.CopyFramework("non-existent-path.framework", Path.Combine(_xcodeProjectPath, "SomeDirectory", "Test.framework"), new TestLogger()));