Beispiel #1
0
        public void testQuery()
        {
            TFSAccessor        t   = TFSAccessor.TFSAccessorFactory("", "", "", "");
            WorkItemCollection wic = t.GetReleaseNotesFromQuery();

            Assert.IsNotNull(wic);
        }
Beispiel #2
0
        /// <summary>
        /// Factory pattern interface for creating a TfsAccessor.
        /// Catches errors relates to creating the interface (ie. authentication issues)
        /// </summary>
        /// <returns>A TfsAccessor</returns>
        public static TFSAccessor TFSAccessorFactory(string serverTeamProjectUrl, string projectName, string iterationNumber, string projectSubpath = "")
        {
            var errorLogger = (new Logger())
                              .SetMessage("Connected to TFS")
                              .SetLoggingType(Logger.Type.Information);

            try
            {
                TFSAccessor a = new TFSAccessor(serverTeamProjectUrl, projectName, iterationNumber, projectSubpath);
                if (a != null)
                {
                    errorLogger.Display();
                }
                return(a);
            }
            catch (Exception e)
            {
                errorLogger.SetMessage(e.Message).SetLoggingType(Logger.Type.Error).Display();
                return(null);
            }
        }
Beispiel #3
0
        public void testConnection()
        {
            TFSAccessor t = TFSAccessor.TFSAccessorFactory("", "", "", "");

            Assert.IsNotNull(t);
        }
Beispiel #4
0
		/// <summary>
		/// Factory pattern interface for creating a TfsAccessor.
		/// Catches errors relates to creating the interface (ie. authentication issues)
		/// </summary>
		/// <returns>A TfsAccessor</returns>
		public static TFSAccessor TFSAccessorFactory(string serverTeamProjectUrl, string projectName, string iterationNumber, string projectSubpath = "")
		{
			var errorLogger = (new Logger())
				.SetMessage("Connected to TFS")
				.SetLoggingType(Logger.Type.Information);
			try
			{
				TFSAccessor a = new TFSAccessor(serverTeamProjectUrl, projectName, iterationNumber, projectSubpath);
				if (a != null)
					errorLogger.Display();
				return a;
			}
			catch (Exception e)
			{
				errorLogger.SetMessage(e.Message).SetLoggingType(Logger.Type.Error).Display();
				return null;
			}
		}