@@ -46,9 +46,9 @@ public void ShouldParseSingleCommit()
4646 {
4747 new GitLogEntry ( "1cd4b9154a88bc8c7b09cb8cacc79bf1d5bde8cf" ,
4848 "Author Person" , "author@example.com" ,
49- "Author Person" , "author@example.com" ,
50- "Rename RepositoryModelBase to RepositoryModel" ,
49+ "Author Person" , "author@example.com" ,
5150 "Rename RepositoryModelBase to RepositoryModel" ,
51+ "" ,
5252 commitTime , commitTime ,
5353 new List < GitStatusEntry >
5454 {
@@ -61,6 +61,94 @@ public void ShouldParseSingleCommit()
6161 AssertProcessOutput ( output , expected ) ;
6262 }
6363
64+ [ Test ]
65+ public void ShouldParseSummaryAndDescription ( )
66+ {
67+ var output = new [ ]
68+ {
69+ "1cd4b9154a88bc8c7b09cb8cacc79bf1d5bde8cf" ,
70+ "865b8d9d6e5e3bd6d7a4dc9c9f3588192314942c" ,
71+ "Author Person" ,
72+ "author@example.com" ,
73+ "2017-01-06T15:36:57+01:00" ,
74+ "Author Person" ,
75+ "author@example.com" ,
76+ "2017-01-06T15:36:57+01:00" ,
77+ "Rename RepositoryModelBase to RepositoryModel" ,
78+ "" ,
79+ "This is a line on the description" ,
80+ "---GHUBODYEND---" ,
81+ "M src/GitHub.App/Models/RemoteRepositoryModel.cs" ,
82+ null ,
83+ } ;
84+
85+ var commitTime = new DateTimeOffset ( 2017 , 1 , 6 , 15 , 36 , 57 , TimeSpan . FromHours ( 1 ) ) ;
86+
87+ var expected = new [ ]
88+ {
89+ new GitLogEntry ( "1cd4b9154a88bc8c7b09cb8cacc79bf1d5bde8cf" ,
90+ "Author Person" , "author@example.com" ,
91+ "Author Person" , "author@example.com" ,
92+ "Rename RepositoryModelBase to RepositoryModel" ,
93+ "This is a line on the description" ,
94+ commitTime ,
95+ commitTime ,
96+ new List < GitStatusEntry >
97+ {
98+ new GitStatusEntry ( "src/GitHub.App/Models/RemoteRepositoryModel.cs" ,
99+ TestRootPath + @"\src/GitHub.App/Models/RemoteRepositoryModel.cs" , null ,
100+ GitFileStatus . Modified ) ,
101+ } )
102+ } ;
103+
104+ AssertProcessOutput ( output , expected ) ;
105+ }
106+
107+ [ Test ]
108+ public void ShouldParseSummaryAndDescriptionWithExtraNewLines ( )
109+ {
110+ var output = new [ ]
111+ {
112+ "1cd4b9154a88bc8c7b09cb8cacc79bf1d5bde8cf" ,
113+ "865b8d9d6e5e3bd6d7a4dc9c9f3588192314942c" ,
114+ "Author Person" ,
115+ "author@example.com" ,
116+ "2017-01-06T15:36:57+01:00" ,
117+ "Author Person" ,
118+ "author@example.com" ,
119+ "2017-01-06T15:36:57+01:00" ,
120+ "Rename RepositoryModelBase to RepositoryModel" ,
121+ "" ,
122+ "" ,
123+ "" ,
124+ "This is a line on the description" ,
125+ "---GHUBODYEND---" ,
126+ "M src/GitHub.App/Models/RemoteRepositoryModel.cs" ,
127+ null ,
128+ } ;
129+
130+ var commitTime = new DateTimeOffset ( 2017 , 1 , 6 , 15 , 36 , 57 , TimeSpan . FromHours ( 1 ) ) ;
131+
132+ var expected = new [ ]
133+ {
134+ new GitLogEntry ( "1cd4b9154a88bc8c7b09cb8cacc79bf1d5bde8cf" ,
135+ "Author Person" , "author@example.com" ,
136+ "Author Person" , "author@example.com" ,
137+ "Rename RepositoryModelBase to RepositoryModel" ,
138+ Environment . NewLine + Environment . NewLine + "This is a line on the description" ,
139+ commitTime ,
140+ commitTime ,
141+ new List < GitStatusEntry >
142+ {
143+ new GitStatusEntry ( "src/GitHub.App/Models/RemoteRepositoryModel.cs" ,
144+ TestRootPath + @"\src/GitHub.App/Models/RemoteRepositoryModel.cs" , null ,
145+ GitFileStatus . Modified ) ,
146+ } )
147+ } ;
148+
149+ AssertProcessOutput ( output , expected ) ;
150+ }
151+
64152 private void AssertProcessOutput ( IEnumerable < string > lines , GitLogEntry [ ] expected )
65153 {
66154 var gitObjectFactory = SubstituteFactory . CreateGitObjectFactory ( TestRootPath ) ;
@@ -77,4 +165,4 @@ private void AssertProcessOutput(IEnumerable<string> lines, GitLogEntry[] expect
77165 results . AssertEqual ( expected ) ;
78166 }
79167 }
80- }
168+ }
0 commit comments