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

            Assert.IsNotNull(wic);
        }
示例#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);
            }
        }
示例#3
0
        public void testConnection()
        {
            TFSAccessor t = TFSAccessor.TFSAccessorFactory("", "", "", "");

            Assert.IsNotNull(t);
        }
示例#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;
			}
		}