예제 #1
0
		public void ParseUserFile_MissingEmail()
		{
			using (var reader = new StringReader(UserMapResources.MissingEmail))
			{
				var map = new UserMap("example.com");
				map.ParseUserFile(reader, "User File");
			}
		}
예제 #2
0
		public void ParseUserFile_Duplicate()
		{
			using (var reader = new StringReader(UserMapResources.Duplicate))
			{
				var map = new UserMap("example.com");
				map.ParseUserFile(reader, "User File");
			}
		}
예제 #3
0
		public void ParseUserFile_ExtraField()
		{
			using (var reader = new StringReader(UserMapResources.ExtraField))
			{
				var map = new UserMap("example.com");
				map.ParseUserFile(reader, "User File");
			}
		}
예제 #4
0
		public void GetUser_NotFound()
		{
			var map = new UserMap("example.com");
			var user = map.GetUser("fred");

			Assert.AreEqual(user.Name, "fred");
			Assert.AreEqual(user.Email, "*****@*****.**");
			Assert.IsTrue(user.Generated);
		}
예제 #5
0
 public Importer(ILogger log, IConfig config, UserMap userMap, BranchStreamCollection branches,
                 IDictionary <string, Commit> tags, Cvs cvs)
 {
     m_log      = log;
     m_config   = config;
     m_userMap  = userMap;
     m_branches = branches;
     m_tags     = tags;
     m_cvs      = cvs;
     m_player   = new CommitPlayer(log, branches);
 }
예제 #6
0
		public Importer(ILogger log, IConfig config, UserMap userMap, BranchStreamCollection branches,
				IDictionary<string, Commit> tags, Cvs cvs)
		{
			m_log = log;
			m_config = config;
			m_userMap = userMap;
			m_branches = branches;
			m_tags = tags;
			m_cvs = cvs;
			m_player = new CommitPlayer(log, branches);
		}
예제 #7
0
        private UserMap GetUserMap()
        {
            var m_userMap = new UserMap(this.DefaultDomain);

            m_userMap.AddEntry("", this.Nobody);

            if (m_switches.UserFile != null)
            {
                m_userMap.ParseUserFile(m_switches.UserFile);
            }

            return(m_userMap);
        }
예제 #8
0
		public void GetUser_FromFile()
		{
			using (var reader = new StringReader(UserMapResources.Good))
			{
				var map = new UserMap("blah.com");
				map.ParseUserFile(reader, "User File");

				var joe = map.GetUser("joe");
				Assert.AreEqual(joe.Name, "Joe Bloggs");
				Assert.AreEqual(joe.Email, "*****@*****.**");
				Assert.IsFalse(joe.Generated);

				var fred = map.GetUser("fred");
				Assert.AreEqual(fred.Name, "Fred X");
				Assert.AreEqual(fred.Email, "*****@*****.**");
				Assert.IsFalse(fred.Generated);
			}
		}
예제 #9
0
		private UserMap GetUserMap()
		{
			var m_userMap = new UserMap(this.DefaultDomain);
			m_userMap.AddEntry("", this.Nobody);

			if (m_switches.UserFile != null)
				m_userMap.ParseUserFile(m_switches.UserFile);

			return m_userMap;
		}