public void SetUp() { this.buildServerMock = MockRepository.GenerateMock <IBuildServer>(); this.buildDetailSpecMock = MockRepository.GenerateMock <IBuildDetailSpec>(); this.buildQueryResultMock = MockRepository.GenerateMock <IBuildQueryResult>(); this.communicator = new BuildCommunicator("http://www.tfs.com"); this.communicator.buildServer = buildServerMock; }
private static void GetBuildInfo(BuildCommunicator communicator) { Console.WriteLine("Getting TFS Build info for all projects..."); BuildStatus info = communicator.GetBuildInformation(); CleanBuildStatusFile(); WriteBuildStatusToFile(info); Console.WriteLine("Written build info to buildstatus.json. [waiting...] "); Thread.Sleep(20000); }
private static void Main(string[] args) { Console.WriteLine("TFS Build status; connecting..."); BuildCommunicator communicator = new BuildCommunicator(ConfigurationManager.AppSettings["tfsServer"]); while (true) { try { GetBuildInfo(communicator); } catch (Exception e) { Console.WriteLine("Whoops, something went wrong: " + e.Message); Console.WriteLine("Don't worry, we'll retry..."); } } }