Skip to content

Commit 6b90286

Browse files
change pmengal#31 - Update export ToString code.
1 parent c343123 commit 6b90286

6 files changed

Lines changed: 30 additions & 10 deletions

File tree

2.27 MB
Binary file not shown.

ActiveUp.Net-vs2017.sln

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25123.0
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26730.10
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Class Library", "Class Library", "{629D406B-F46A-4A9D-A31F-C5956E0AB157}"
77
EndProject
@@ -633,4 +633,7 @@ Global
633633
{5AD3438E-9024-4908-BA15-92726159C4FB} = {33BAFFED-FB5D-48EF-85D9-CDE2EB2CFA64}
634634
{25DA9502-B959-4E81-9368-471AE231BCC0} = {629D406B-F46A-4A9D-A31F-C5956E0AB157}
635635
EndGlobalSection
636+
GlobalSection(ExtensibilityGlobals) = postSolution
637+
SolutionGuid = {BBCFB72D-84B7-4F14-BA2E-A464210881F7}
638+
EndGlobalSection
636639
EndGlobal

Class Library/ActiveUp.Net.Common/TraceInfo.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,22 @@ private void Initialize(string from, DateTime date, string by, string via, strin
9595
public override string ToString()
9696
{
9797
string source = string.Empty;
98-
if (!From.Equals(string.Empty))
98+
if (!string.IsNullOrEmpty(From))
9999
source += " from " + From + "\r\n ";
100-
if (!By.Equals(string.Empty))
100+
if (!string.IsNullOrEmpty(By))
101101
source += " by " + By + "\r\n ";
102-
if (!With.Equals(string.Empty))
102+
if (!string.IsNullOrEmpty(With))
103103
source += " with " + With + "\r\n ";
104-
if (!For.Equals(string.Empty))
104+
if (!string.IsNullOrEmpty(For))
105105
source += " for " + For + "\r\n ";
106-
if (!Via.Equals(string.Empty))
106+
if (!string.IsNullOrEmpty(Via))
107107
source += " via " + Via + "\r\n ";
108-
if (!Id.Equals(string.Empty))
108+
if (!string.IsNullOrEmpty(Id))
109109
source += " id " + Id + "\r\n ";
110110

111111
if (string.IsNullOrEmpty(source))
112112
return "";
113-
return source.Remove(0,source.Length - 3) + ";" + Date.ToString("r");
113+
return source.Remove(0, source.Length - 3) + ";" + Date.ToString("r");
114114
}
115115
}
116116
}

Class Library/ActiveUp.Net.Tests/ActiveUp.Net.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
<Compile Include="Common\MimePartTests.cs" />
8383
<Compile Include="Common\RFC2047\Rfc2047DecoderTests.cs" />
8484
<Compile Include="Common\RFC2047\Rfc2047DecoderTests.Splitter.cs" />
85+
<Compile Include="Common\TraceInfoTests.cs" />
8586
<Compile Include="FluentTests.cs" />
8687
<Compile Include="Groupware\ParserTests.cs" />
8788
<Compile Include="ImapTests.cs" />

Class Library/ActiveUp.Net.Tests/Common/ParserTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using ActiveUp.Net.Mail;
44
using NUnit.Framework;
55
using System.Reflection;
6-
using System.Text;
76

87
namespace ActiveUp.Net.Tests.Common
98
{
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using ActiveUp.Net.Mail;
2+
using NUnit.Framework;
3+
using System;
4+
5+
namespace ActiveUp.Net.Tests.Common
6+
{
7+
[TestFixture]
8+
public class TraceInfoTests
9+
{
10+
[Test]
11+
public void should_process_null_values()
12+
{
13+
var test = new TraceInfo(null, DateTime.MinValue, null, null, null, null, null);
14+
Assert.AreEqual("", test.ToString());
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)